diff --git a/deploy/helm/grafana-operator/templates/_helpers.tpl b/deploy/helm/grafana-operator/templates/_helpers.tpl index dbf65f4dd..3e1979102 100644 --- a/deploy/helm/grafana-operator/templates/_helpers.tpl +++ b/deploy/helm/grafana-operator/templates/_helpers.tpl @@ -47,6 +47,10 @@ helm.sh/chart: {{ include "grafana-operator.chart" . }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/part-of: grafana-operator +{{- with .Values.additionalLabels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/deploy/helm/grafana-operator/templates/cm.yaml b/deploy/helm/grafana-operator/templates/cm.yaml index e2f54540a..69dd923b1 100644 --- a/deploy/helm/grafana-operator/templates/cm.yaml +++ b/deploy/helm/grafana-operator/templates/cm.yaml @@ -5,9 +5,8 @@ metadata: name: {{ include "grafana-operator.fullname" . }} namespace: {{ include "grafana-operator.namespace" . }} labels: - {{- with .Values.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} + {{- include "grafana-operator.labels" . | nindent 4 }} + app.kubernetes.io/component: operator data: controller_manager_config.yaml: | apiVersion: controller-runtime.sigs.k8s.io/v1alpha1 diff --git a/deploy/helm/grafana-operator/templates/deployment.yaml b/deploy/helm/grafana-operator/templates/deployment.yaml index 1cdd10724..7ba3f6739 100644 --- a/deploy/helm/grafana-operator/templates/deployment.yaml +++ b/deploy/helm/grafana-operator/templates/deployment.yaml @@ -5,9 +5,7 @@ metadata: namespace: {{ include "grafana-operator.namespace" . }} labels: {{- include "grafana-operator.labels" . | nindent 4 }} - {{- with .Values.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} + app.kubernetes.io/component: operator spec: replicas: 1 selector: @@ -21,9 +19,7 @@ spec: {{- end }} labels: {{- include "grafana-operator.selectorLabels" . | nindent 8 }} - {{- with .Values.additionalLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} + app.kubernetes.io/component: operator spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/deploy/helm/grafana-operator/templates/rbac.yaml b/deploy/helm/grafana-operator/templates/rbac.yaml index 749d3dfae..9d61e1e3a 100644 --- a/deploy/helm/grafana-operator/templates/rbac.yaml +++ b/deploy/helm/grafana-operator/templates/rbac.yaml @@ -21,9 +21,7 @@ metadata: name: {{ include "grafana-operator.fullname" $ }} labels: {{- include "grafana-operator.labels" $ | nindent 4 }} - {{- with $.Values.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} + app.kubernetes.io/component: operator rules: {{- toYaml $rbac.rules | nindent 2 }} {{- if $isOpenShift }} @@ -39,9 +37,7 @@ metadata: {{- end }} labels: {{- include "grafana-operator.labels" $ | nindent 4 }} - {{- with $.Values.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} + app.kubernetes.io/component: operator subjects: - kind: ServiceAccount name: {{ include "grafana-operator.serviceAccountName" $ }} diff --git a/deploy/helm/grafana-operator/templates/service.yaml b/deploy/helm/grafana-operator/templates/service.yaml index d7ad43f49..9cbbc0880 100644 --- a/deploy/helm/grafana-operator/templates/service.yaml +++ b/deploy/helm/grafana-operator/templates/service.yaml @@ -5,9 +5,7 @@ metadata: namespace: {{ include "grafana-operator.namespace" . }} labels: {{- include "grafana-operator.labels" . | nindent 4 }} - {{- with .Values.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} + app.kubernetes.io/component: operator spec: type: {{ .Values.metricsService.type }} ports: diff --git a/deploy/helm/grafana-operator/templates/serviceaccount.yaml b/deploy/helm/grafana-operator/templates/serviceaccount.yaml index 9be898849..0cfa1d63f 100644 --- a/deploy/helm/grafana-operator/templates/serviceaccount.yaml +++ b/deploy/helm/grafana-operator/templates/serviceaccount.yaml @@ -6,9 +6,7 @@ metadata: namespace: {{ include "grafana-operator.namespace" . }} labels: {{- include "grafana-operator.labels" . | nindent 4 }} - {{- with .Values.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} + app.kubernetes.io/component: operator {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/deploy/helm/grafana-operator/templates/servicemonitor.yaml b/deploy/helm/grafana-operator/templates/servicemonitor.yaml index e423f89ca..00899ae85 100644 --- a/deploy/helm/grafana-operator/templates/servicemonitor.yaml +++ b/deploy/helm/grafana-operator/templates/servicemonitor.yaml @@ -6,9 +6,7 @@ metadata: namespace: {{ include "grafana-operator.namespace" . }} labels: {{- include "grafana-operator.labels" . | nindent 4 }} - {{- with .Values.additionalLabels }} - {{- toYaml . | nindent 4 }} - {{- end }} + app.kubernetes.io/component: operator {{- with .Values.serviceMonitor.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }}