MongoDB kubernetes operator - follow recommended kubernetes object labeling -
Hi, i would like to thank you first for this operator, good job đź‘Ť . It works well.
Did you consider using this label convention for objects (statefulset, svc, secrets) https://kubernetes.io/docs/concepts/overview/working-with-objects/common-labels/?
Currently in my cluster Im trying to follow these recommended labels for objects while Im forwarding kubernetes logs using EFK but cannot store log to elasticsearch because there is object mapping for kubernetes.labels.app
field as object not a concrete value. Right now there is hard-coded service selector https://github.com/mongodb/mongodb-kubernetes-operator/blob/1aa7093d2cc977bc3b1f5a5fa7e1e902d37768c8/controllers/replica_set_controller.go#L455 which expects pods to be labeled with app=<serviceName>
Example labels following conventions for statefulset:
apiVersion: apps/v1
kind: StatefulSet
metadata:
labels:
app.kubernetes.io/name: mongodb-svc # or custom service name
app.kubernetes.io/version: "4.4.9"
app.kubernetes.io/component: database
app.kubernetes.io/part-of: mongodb-rs
app.kubernetes.io/managed-by: helm
app.kubernetes.io/created-by: mongodb-community-operator
I know its my issue, which is not directly related to the operator and i have to solve at my end but would be great if operator follow recommended labels and makes life easier.
No current plans, but under consideration for inclusion on the roadmap in the future.