Default labels do not comply with recommendation
criscola opened this issue · 1 comments
criscola commented
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
- The created-by label is deprecated since v1.9.
- The instance label is misused because it should be applied to workload resources and be unique for that instance, not for that resource.
- 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.
- 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: