Manage indexes creation and sharding of collections in a GitOps way
We're developing a Microservices-based product that is based on MongoDB and Kafka. In this context, we're currently aiming at implementing most of our DevOps-related activities in a GitOps way. Setup, rolling upgrades and scaling the number of replicas can be achieved with the Operator today, but it would be great also if activities like index creation and sharding of collections could be done via the Operator.
A similar approach has been taken for Kafka, where cluster installation, rolling upgrades and scaling out is handed by the operator (Strimzi), but also topic management: https://strimzi.io/docs/operators/latest/overview.html#overview-concepts-topic-operator-str
We have developed an internal tool to manage indexes in a similar fashion, i.e. we can declare indexes in a ConfigMap, versioned in Git, and have an Openshift job that checks if the indexes declared in it are present and, if not, creates them. This allows us to have a declarative way of managing indexes and it would be great if this could be a feature of the operator.