Manage Database by Kubernetes Operator
In our use case, we are dynamically creating feature environments based on the branch name. During this process, we are also creating MongoDB databases in the same Atlas cluster (different envs are sharing the same cluster but with different database names). For now, we need to do it with a separate CI step that should create this DB and delete it when the env is deleted.
It would be great to have the possibility to manage DB create/delete process with Kubernetes CRD. For now it's the only 1 missing feature that is blocking us to start using Operator.
This is something we're considering for the future.
But the biggest problem we need to solve is that it's incredibly easy to create/delete/update databases within a deployment via many other interfaces. But if this happens, the Operator's source of truth (the custom resources) won't contain the changes, and the Operator would overwrite the changes using it's source of truth.
-
Yevhenii commented
"Operator would overwrite the changes using it's source of truth" - that's exactly what we are expecting to have. If you are following infrastructure-as-a-code style there should be only one source of truth - Operator CRD.
You could take as example Kafka operator which allows to create a topic via CRD. The topic, like a Mongo DB could also be created/updated by many other interfaces, but if it is defined as a CRD - the operator is the source of truth and it will rollback any other external changes.