Use separate tls.crt and tls.key items in a kubernetes secret for certificates instead of a combined item named server.pem for a MondoDB rep
There should be a way to use separate tls.crt
and tls.key
items in a kubernetes secret for certificates instead of a combined item named server.pem
.
We request our certs using cert-manager which generates secrets from the cert CRD and will get auto renewed every so often. These secrets have 2 items, tls.crt
and tls.key
.
So far the only way I have seen to enable tls is to combine these 2 items and rename it into a new secret in kubernetes as item called server.pem
. This however means that when a cert auto renews that the wrong secret is being used. So our replicaSets would break on each renewal (every 90 days).
If some flexibility was built in on how to provide certificates to the replicaSet, there would be no issue and auto renewing our certs would not break MongoDB in production every 90 days.
![](https://secure.gravatar.com/avatar/d51eda2c0b610a2ac9fa99a2048faa66?size=40&default=https%3A%2F%2Fassets.uvcdn.com%2Fpkg%2Fadmin%2Ficons%2Fuser_70-6bcf9e08938533adb9bac95c3e487cb2a6d4a32f890ca6fdc82e3072e0ea0368.png)
Support for Cert Manager as well as support for separate crt and key is on a roadmap.
We will look into updating our docs to describe cert rotation.
-
Mattias commented
It would be good if the operator could follow the Kubernetes secrets default settings as defined in the Kubernetes documentation https://kubernetes.io/docs/concepts/configuration/secret/#tls-secrets
This will not only cover the use-case of cert-manager, but also the other use-cases