operator-framework/operator-sdk

Default labels do not comply with recommendation

criscola opened this issue · 1 comments

I would like to propose a few changes to the default labels as generated by the operator-sdk.
Let's take the Namespace object generated by kustomize:

apiVersion: v1
kind: Namespace
metadata:
  labels:
    app.kubernetes.io/component: manager
    app.kubernetes.io/created-by: myoperator
    app.kubernetes.io/instance: system
    app.kubernetes.io/managed-by: kustomize
    app.kubernetes.io/name: namespace
    app.kubernetes.io/part-of: myoperator
    control-plane: controller-manager
  name: myoperator-system
  1. The created-by label is deprecated since v1.9.
  2. The instance label is misused because it should be applied to workload resources and be unique for that instance, not for that resource.
  3. The name label is misused because it should be the same for all resources and have the operator's name, not the kind of resource.
  4. The control-plane label is misleading since it confuses administrators; the controller-manager is a control-plane component, not a Kubernetes operator nor a normal controller. It is used as label selector. This label could be replaced entirely by the name label once corrected.

References: