diff --git a/cluster/charts/rook-ceph/templates/_helpers.tpl b/cluster/charts/rook-ceph/templates/_helpers.tpl index 529b4901755eb..05326312651ce 100644 --- a/cluster/charts/rook-ceph/templates/_helpers.tpl +++ b/cluster/charts/rook-ceph/templates/_helpers.tpl @@ -24,3 +24,15 @@ imagePullSecrets: {{ toYaml .Values.imagePullSecrets }} {{- end -}} {{- end -}} + +{{/* +Common labels +*/}} +{{- define "rook-ceph.labels" -}} +app.kubernetes.io/name: rook-ceph +app.kubernetes.io/instance: rook-ceph +app.kubernetes.io/component: csi +app.kubernetes.io/part-of: rook-ceph +app.kubernetes.io/managed-by: rook-ceph-operator +app.kubernetes.io/created-by: rook-ceph-operator +{{- end -}} diff --git a/cluster/charts/rook-ceph/templates/clusterrole.yaml b/cluster/charts/rook-ceph/templates/clusterrole.yaml index d9565da51fbf9..fbdd9ba0f72de 100644 --- a/cluster/charts/rook-ceph/templates/clusterrole.yaml +++ b/cluster/charts/rook-ceph/templates/clusterrole.yaml @@ -6,6 +6,7 @@ metadata: labels: operator: rook storage-backend: ceph + {{- include "rook-ceph.labels" . | nindent 4 }} rules: # Most resources are represented by a string representation of their name, such as “pods”, just as it appears in the URL for the relevant API endpoint. # However, some Kubernetes APIs involve a “subresource”, such as the logs for a pod. [...] @@ -460,7 +461,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" rules: - apiGroups: - policy diff --git a/cluster/charts/rook-ceph/templates/clusterrolebinding.yaml b/cluster/charts/rook-ceph/templates/clusterrolebinding.yaml index d3c22ca74c696..42fbe4f9954bc 100644 --- a/cluster/charts/rook-ceph/templates/clusterrolebinding.yaml +++ b/cluster/charts/rook-ceph/templates/clusterrolebinding.yaml @@ -23,7 +23,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -122,7 +122,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -140,7 +140,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole @@ -157,7 +157,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole diff --git a/cluster/charts/rook-ceph/templates/deployment.yaml b/cluster/charts/rook-ceph/templates/deployment.yaml index 7efb599ebe433..4e475fe13e64a 100644 --- a/cluster/charts/rook-ceph/templates/deployment.yaml +++ b/cluster/charts/rook-ceph/templates/deployment.yaml @@ -5,7 +5,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" spec: replicas: 1 selector: @@ -15,7 +15,7 @@ spec: metadata: labels: app: rook-ceph-operator - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{- if .Values.annotations }} annotations: {{ toYaml .Values.annotations | indent 8 }} diff --git a/cluster/charts/rook-ceph/templates/serviceaccount.yaml b/cluster/charts/rook-ceph/templates/serviceaccount.yaml index f9317cb0a8962..3dbe7fb135096 100644 --- a/cluster/charts/rook-ceph/templates/serviceaccount.yaml +++ b/cluster/charts/rook-ceph/templates/serviceaccount.yaml @@ -7,7 +7,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{ template "imagePullSecrets" . }} --- # Service account for the Ceph OSDs. Must exist and cannot be renamed. @@ -19,7 +19,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{ template "imagePullSecrets" . }} --- # Service account for the Ceph Mgr. Must exist and cannot be renamed. @@ -31,7 +31,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{ template "imagePullSecrets" . }} --- apiVersion: v1 @@ -42,7 +42,7 @@ metadata: labels: operator: rook storage-backend: ceph - chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" {{ template "imagePullSecrets" . }} --- # Service account for the cephfs csi driver