From f88a3f18eeee000a2a894e780de013ff01902b93 Mon Sep 17 00:00:00 2001 From: "BOSSER, Bastien" Date: Fri, 14 Oct 2022 16:59:09 +0200 Subject: [PATCH] add commonLabels value Signed-off-by: BOSSER, Bastien --- charts/ceph-csi-cephfs/README.md | 1 + charts/ceph-csi-cephfs/templates/ceph-conf.yaml | 1 + charts/ceph-csi-cephfs/templates/csiplugin-configmap.yaml | 1 + charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml | 2 ++ charts/ceph-csi-cephfs/templates/nodeplugin-http-service.yaml | 1 + .../ceph-csi-cephfs/templates/nodeplugin-serviceaccount.yaml | 1 + charts/ceph-csi-cephfs/templates/provisioner-clusterrole.yaml | 1 + .../templates/provisioner-clusterrolebinding.yaml | 1 + charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml | 2 ++ charts/ceph-csi-cephfs/templates/provisioner-http-service.yaml | 1 + charts/ceph-csi-cephfs/templates/provisioner-role.yaml | 1 + charts/ceph-csi-cephfs/templates/provisioner-rolebinding.yaml | 1 + .../ceph-csi-cephfs/templates/provisioner-serviceaccount.yaml | 1 + charts/ceph-csi-cephfs/templates/secret.yaml | 1 + charts/ceph-csi-cephfs/templates/storageclass.yaml | 1 + charts/ceph-csi-cephfs/values.yaml | 3 +++ charts/ceph-csi-rbd/README.md | 1 + charts/ceph-csi-rbd/templates/ceph-conf.yaml | 1 + charts/ceph-csi-rbd/templates/csiplugin-configmap.yaml | 1 + charts/ceph-csi-rbd/templates/encryptionkms-configmap.yaml | 1 + charts/ceph-csi-rbd/templates/nodeplugin-clusterrole.yaml | 1 + .../ceph-csi-rbd/templates/nodeplugin-clusterrolebinding.yaml | 1 + charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml | 2 ++ charts/ceph-csi-rbd/templates/nodeplugin-http-service.yaml | 1 + charts/ceph-csi-rbd/templates/nodeplugin-serviceaccount.yaml | 1 + charts/ceph-csi-rbd/templates/provisioner-clusterrole.yaml | 1 + .../ceph-csi-rbd/templates/provisioner-clusterrolebinding.yaml | 1 + charts/ceph-csi-rbd/templates/provisioner-deployment.yaml | 2 ++ charts/ceph-csi-rbd/templates/provisioner-http-service.yaml | 1 + charts/ceph-csi-rbd/templates/provisioner-role.yaml | 1 + charts/ceph-csi-rbd/templates/provisioner-rolebinding.yaml | 1 + charts/ceph-csi-rbd/templates/provisioner-serviceaccount.yaml | 1 + charts/ceph-csi-rbd/templates/secret.yaml | 1 + charts/ceph-csi-rbd/templates/storageclass.yaml | 1 + charts/ceph-csi-rbd/values.yaml | 3 +++ 35 files changed, 43 insertions(+) diff --git a/charts/ceph-csi-cephfs/README.md b/charts/ceph-csi-cephfs/README.md index a3cb3379eb55..20f1868abbb6 100644 --- a/charts/ceph-csi-cephfs/README.md +++ b/charts/ceph-csi-cephfs/README.md @@ -85,6 +85,7 @@ charts and their default values. | `serviceAccounts.provisioner.create` | Specifies whether a provisioner ServiceAccount should be created | `true` | | `serviceAccounts.provisioner.name` | The name of the provisioner ServiceAccount of provisioner to use. If not set and create is true, a name is generated using the fullname | "" | | `csiConfig` | Configuration for the CSI to connect to the cluster | [] | +| `commonLabels` | Labels to apply to all resources | `{}` | | `logLevel` | Set logging level for csi containers. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity. | `5` | | `sidecarLogLevel` | Set logging level for csi sidecar containers. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity. | `1` | | `nodeplugin.name` | Specifies the nodeplugin name | `nodeplugin` | diff --git a/charts/ceph-csi-cephfs/templates/ceph-conf.yaml b/charts/ceph-csi-cephfs/templates/ceph-conf.yaml index 3c8f8a47b10d..e8ca33d0259c 100644 --- a/charts/ceph-csi-cephfs/templates/ceph-conf.yaml +++ b/charts/ceph-csi-cephfs/templates/ceph-conf.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} data: ceph.conf: | {{ tpl .Values.cephconf . | indent 4 }} diff --git a/charts/ceph-csi-cephfs/templates/csiplugin-configmap.yaml b/charts/ceph-csi-cephfs/templates/csiplugin-configmap.yaml index 1f59b66cecbc..605710c2501e 100644 --- a/charts/ceph-csi-cephfs/templates/csiplugin-configmap.yaml +++ b/charts/ceph-csi-cephfs/templates/csiplugin-configmap.yaml @@ -10,6 +10,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} data: config.json: |- {{ toJson .Values.csiConfig | indent 4 -}} diff --git a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml index 1a499bb60cbe..f022ed57a987 100644 --- a/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml +++ b/charts/ceph-csi-cephfs/templates/nodeplugin-daemonset.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: selector: matchLabels: @@ -25,6 +26,7 @@ spec: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }} spec: serviceAccountName: {{ include "ceph-csi-cephfs.serviceAccountName.nodeplugin" . }} {{- if .Values.nodeplugin.priorityClassName }} diff --git a/charts/ceph-csi-cephfs/templates/nodeplugin-http-service.yaml b/charts/ceph-csi-cephfs/templates/nodeplugin-http-service.yaml index 95fee84f2e30..8aaf1260a344 100644 --- a/charts/ceph-csi-cephfs/templates/nodeplugin-http-service.yaml +++ b/charts/ceph-csi-cephfs/templates/nodeplugin-http-service.yaml @@ -14,6 +14,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: {{- if .Values.nodeplugin.httpMetrics.service.clusterIP }} clusterIP: "{{ .Values.nodeplugin.httpMetrics.service.clusterIP }}" diff --git a/charts/ceph-csi-cephfs/templates/nodeplugin-serviceaccount.yaml b/charts/ceph-csi-cephfs/templates/nodeplugin-serviceaccount.yaml index 5dedaf4b0b81..77b5d5e831af 100644 --- a/charts/ceph-csi-cephfs/templates/nodeplugin-serviceaccount.yaml +++ b/charts/ceph-csi-cephfs/templates/nodeplugin-serviceaccount.yaml @@ -10,4 +10,5 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} {{- end -}} diff --git a/charts/ceph-csi-cephfs/templates/provisioner-clusterrole.yaml b/charts/ceph-csi-cephfs/templates/provisioner-clusterrole.yaml index 667e7c9231d3..6272cf918856 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-clusterrole.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-clusterrole.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} rules: - apiGroups: [""] resources: ["secrets"] diff --git a/charts/ceph-csi-cephfs/templates/provisioner-clusterrolebinding.yaml b/charts/ceph-csi-cephfs/templates/provisioner-clusterrolebinding.yaml index 82d5d13169ec..7417a749179e 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-clusterrolebinding.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-clusterrolebinding.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} subjects: - kind: ServiceAccount name: {{ include "ceph-csi-cephfs.serviceAccountName.provisioner" . }} diff --git a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml index 6d3c371cbc52..10feec7ea49e 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-deployment.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: replicas: {{ .Values.provisioner.replicaCount }} strategy: @@ -30,6 +31,7 @@ spec: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }} spec: {{- if gt (int .Values.provisioner.replicaCount) 1 }} affinity: diff --git a/charts/ceph-csi-cephfs/templates/provisioner-http-service.yaml b/charts/ceph-csi-cephfs/templates/provisioner-http-service.yaml index 5483242421f3..92ecca3cea95 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-http-service.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-http-service.yaml @@ -14,6 +14,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: {{- if .Values.provisioner.httpMetrics.service.clusterIP }} clusterIP: "{{ .Values.provisioner.httpMetrics.service.clusterIP }}" diff --git a/charts/ceph-csi-cephfs/templates/provisioner-role.yaml b/charts/ceph-csi-cephfs/templates/provisioner-role.yaml index d5cc575008aa..d25814c5bd6c 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-role.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-role.yaml @@ -10,6 +10,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} rules: - apiGroups: [""] resources: ["configmaps"] diff --git a/charts/ceph-csi-cephfs/templates/provisioner-rolebinding.yaml b/charts/ceph-csi-cephfs/templates/provisioner-rolebinding.yaml index 66fb72580684..3e77e0aff621 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-rolebinding.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-rolebinding.yaml @@ -10,6 +10,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} subjects: - kind: ServiceAccount name: {{ include "ceph-csi-cephfs.serviceAccountName.provisioner" . }} diff --git a/charts/ceph-csi-cephfs/templates/provisioner-serviceaccount.yaml b/charts/ceph-csi-cephfs/templates/provisioner-serviceaccount.yaml index c4ba5c1887b9..0207133bba6d 100644 --- a/charts/ceph-csi-cephfs/templates/provisioner-serviceaccount.yaml +++ b/charts/ceph-csi-cephfs/templates/provisioner-serviceaccount.yaml @@ -10,4 +10,5 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} {{- end -}} diff --git a/charts/ceph-csi-cephfs/templates/secret.yaml b/charts/ceph-csi-cephfs/templates/secret.yaml index 7063543b7b5a..64124cb0f69d 100644 --- a/charts/ceph-csi-cephfs/templates/secret.yaml +++ b/charts/ceph-csi-cephfs/templates/secret.yaml @@ -9,6 +9,7 @@ metadata: chart: {{ include "ceph-csi-cephfs.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} stringData: adminID: {{ .Values.secret.adminID }} adminKey: {{ .Values.secret.adminKey }} diff --git a/charts/ceph-csi-cephfs/templates/storageclass.yaml b/charts/ceph-csi-cephfs/templates/storageclass.yaml index 4041dec6be9f..a21c998244af 100644 --- a/charts/ceph-csi-cephfs/templates/storageclass.yaml +++ b/charts/ceph-csi-cephfs/templates/storageclass.yaml @@ -12,6 +12,7 @@ metadata: chart: {{ include "ceph-csi-cephfs.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} provisioner: {{ .Values.driverName }} parameters: clusterID: {{ .Values.storageClass.clusterID }} diff --git a/charts/ceph-csi-cephfs/values.yaml b/charts/ceph-csi-cephfs/values.yaml index a37a2505cedf..22e15df602c1 100644 --- a/charts/ceph-csi-cephfs/values.yaml +++ b/charts/ceph-csi-cephfs/values.yaml @@ -30,6 +30,9 @@ serviceAccounts: # netNamespaceFilePath: "{{ .kubeletDir }}/plugins/{{ .driverName }}/net" csiConfig: [] +# Labels to apply to all resources +commonLabels: {} + # Set logging level for csi containers. # Supported values from 0 to 5. 0 for general useful logs, # 5 for trace level verbosity. diff --git a/charts/ceph-csi-rbd/README.md b/charts/ceph-csi-rbd/README.md index 35b4c3291e4f..b6b7f85278d0 100644 --- a/charts/ceph-csi-rbd/README.md +++ b/charts/ceph-csi-rbd/README.md @@ -87,6 +87,7 @@ charts and their default values. | `csiConfig` | Configuration for the CSI to connect to the cluster | [] | | `csiMapping` | Configuration details of clusterID,PoolID,FscID mapping | [] | | `encryptionKMSConfig` | Configuration for the encryption KMS | `{}` | +| `commonLabels` | Labels to apply to all resources | `{}` | | `logLevel` | Set logging level for csi containers. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity. | `5` | | `sidecarLogLevel` | Set logging level for csi sidecar containers. Supported values from 0 to 5. 0 for general useful logs, 5 for trace level verbosity. | `1` | | `nodeplugin.name` | Specifies the nodeplugins name | `nodeplugin` | diff --git a/charts/ceph-csi-rbd/templates/ceph-conf.yaml b/charts/ceph-csi-rbd/templates/ceph-conf.yaml index bcd0e4d39475..d2b0b1b4815f 100644 --- a/charts/ceph-csi-rbd/templates/ceph-conf.yaml +++ b/charts/ceph-csi-rbd/templates/ceph-conf.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} data: ceph.conf: | {{ tpl .Values.cephconf . | indent 4 }} diff --git a/charts/ceph-csi-rbd/templates/csiplugin-configmap.yaml b/charts/ceph-csi-rbd/templates/csiplugin-configmap.yaml index f0944027e6ef..33a0df3c3e2c 100644 --- a/charts/ceph-csi-rbd/templates/csiplugin-configmap.yaml +++ b/charts/ceph-csi-rbd/templates/csiplugin-configmap.yaml @@ -10,6 +10,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} data: config.json: |- {{ toJson .Values.csiConfig | indent 4 }} diff --git a/charts/ceph-csi-rbd/templates/encryptionkms-configmap.yaml b/charts/ceph-csi-rbd/templates/encryptionkms-configmap.yaml index 47b7d093d398..f754fea72eb6 100644 --- a/charts/ceph-csi-rbd/templates/encryptionkms-configmap.yaml +++ b/charts/ceph-csi-rbd/templates/encryptionkms-configmap.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} data: config.json: |- {{ toJson .Values.encryptionKMSConfig | indent 4 -}} diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-clusterrole.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-clusterrole.yaml index 9e24d757edeb..aa8ddd4fd6bc 100644 --- a/charts/ceph-csi-rbd/templates/nodeplugin-clusterrole.yaml +++ b/charts/ceph-csi-rbd/templates/nodeplugin-clusterrole.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} rules: {{- if .Values.topology.enabled }} - apiGroups: [""] diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-clusterrolebinding.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-clusterrolebinding.yaml index bf52865e1c52..ec8ad79b3f9f 100644 --- a/charts/ceph-csi-rbd/templates/nodeplugin-clusterrolebinding.yaml +++ b/charts/ceph-csi-rbd/templates/nodeplugin-clusterrolebinding.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} subjects: - kind: ServiceAccount name: {{ include "ceph-csi-rbd.serviceAccountName.nodeplugin" . }} diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml index aad875423754..fdf85c56fe23 100644 --- a/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml +++ b/charts/ceph-csi-rbd/templates/nodeplugin-daemonset.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: selector: matchLabels: @@ -25,6 +26,7 @@ spec: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }} spec: serviceAccountName: {{ include "ceph-csi-rbd.serviceAccountName.nodeplugin" . }} hostNetwork: true diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-http-service.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-http-service.yaml index 68a3942e8334..e3b18f59a655 100644 --- a/charts/ceph-csi-rbd/templates/nodeplugin-http-service.yaml +++ b/charts/ceph-csi-rbd/templates/nodeplugin-http-service.yaml @@ -14,6 +14,7 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: {{- if .Values.nodeplugin.httpMetrics.service.clusterIP }} clusterIP: "{{ .Values.nodeplugin.httpMetrics.service.clusterIP }}" diff --git a/charts/ceph-csi-rbd/templates/nodeplugin-serviceaccount.yaml b/charts/ceph-csi-rbd/templates/nodeplugin-serviceaccount.yaml index 36e1ee745941..56bd024ddc40 100644 --- a/charts/ceph-csi-rbd/templates/nodeplugin-serviceaccount.yaml +++ b/charts/ceph-csi-rbd/templates/nodeplugin-serviceaccount.yaml @@ -10,4 +10,5 @@ metadata: component: {{ .Values.nodeplugin.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} {{- end -}} diff --git a/charts/ceph-csi-rbd/templates/provisioner-clusterrole.yaml b/charts/ceph-csi-rbd/templates/provisioner-clusterrole.yaml index 70c7670b2f08..fd3778bd8dd8 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-clusterrole.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-clusterrole.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} rules: - apiGroups: [""] resources: ["secrets"] diff --git a/charts/ceph-csi-rbd/templates/provisioner-clusterrolebinding.yaml b/charts/ceph-csi-rbd/templates/provisioner-clusterrolebinding.yaml index 5a086103ab0d..d4077daa9604 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-clusterrolebinding.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-clusterrolebinding.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} subjects: - kind: ServiceAccount name: {{ include "ceph-csi-rbd.serviceAccountName.provisioner" . }} diff --git a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml index f425b174d3c8..a7acd13248fc 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-deployment.yaml @@ -9,6 +9,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: replicas: {{ .Values.provisioner.replicaCount }} strategy: @@ -30,6 +31,7 @@ spec: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 8 }}{{- end }} spec: {{- if gt (int .Values.provisioner.replicaCount) 1 }} affinity: diff --git a/charts/ceph-csi-rbd/templates/provisioner-http-service.yaml b/charts/ceph-csi-rbd/templates/provisioner-http-service.yaml index 0d4c925ecffd..10b0e6787ea2 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-http-service.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-http-service.yaml @@ -14,6 +14,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} spec: {{- if .Values.provisioner.httpMetrics.service.clusterIP }} clusterIP: "{{ .Values.provisioner.httpMetrics.service.clusterIP }}" diff --git a/charts/ceph-csi-rbd/templates/provisioner-role.yaml b/charts/ceph-csi-rbd/templates/provisioner-role.yaml index 3a235a36dc3f..f0b86fb40329 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-role.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-role.yaml @@ -10,6 +10,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} rules: - apiGroups: [""] resources: ["configmaps"] diff --git a/charts/ceph-csi-rbd/templates/provisioner-rolebinding.yaml b/charts/ceph-csi-rbd/templates/provisioner-rolebinding.yaml index 23fa39fed396..62dee476533f 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-rolebinding.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-rolebinding.yaml @@ -10,6 +10,7 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} subjects: - kind: ServiceAccount name: {{ include "ceph-csi-rbd.serviceAccountName.provisioner" . }} diff --git a/charts/ceph-csi-rbd/templates/provisioner-serviceaccount.yaml b/charts/ceph-csi-rbd/templates/provisioner-serviceaccount.yaml index 893b43a9c82c..8acf41a24c1e 100644 --- a/charts/ceph-csi-rbd/templates/provisioner-serviceaccount.yaml +++ b/charts/ceph-csi-rbd/templates/provisioner-serviceaccount.yaml @@ -10,4 +10,5 @@ metadata: component: {{ .Values.provisioner.name }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} {{- end -}} diff --git a/charts/ceph-csi-rbd/templates/secret.yaml b/charts/ceph-csi-rbd/templates/secret.yaml index 1553ceec73a5..3040bcfd0230 100644 --- a/charts/ceph-csi-rbd/templates/secret.yaml +++ b/charts/ceph-csi-rbd/templates/secret.yaml @@ -9,6 +9,7 @@ metadata: chart: {{ include "ceph-csi-rbd.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} stringData: userID: {{ .Values.secret.userID }} userKey: {{ .Values.secret.userKey }} diff --git a/charts/ceph-csi-rbd/templates/storageclass.yaml b/charts/ceph-csi-rbd/templates/storageclass.yaml index fda713ab3a61..a559456aa2b8 100644 --- a/charts/ceph-csi-rbd/templates/storageclass.yaml +++ b/charts/ceph-csi-rbd/templates/storageclass.yaml @@ -12,6 +12,7 @@ metadata: chart: {{ include "ceph-csi-rbd.chart" . }} release: {{ .Release.Name }} heritage: {{ .Release.Service }} + {{- with .Values.commonLabels }}{{ toYaml . | trim | nindent 4 }}{{- end }} provisioner: {{ .Values.driverName }} parameters: clusterID: {{ .Values.storageClass.clusterID }} diff --git a/charts/ceph-csi-rbd/values.yaml b/charts/ceph-csi-rbd/values.yaml index 04d5c628ac2c..5550dc44f5f2 100644 --- a/charts/ceph-csi-rbd/values.yaml +++ b/charts/ceph-csi-rbd/values.yaml @@ -53,6 +53,9 @@ csiMapping: [] # vaultCAVerify: "false" encryptionKMSConfig: {} +# Labels to apply to all resources +commonLabels: {} + # Set logging level for csi containers. # Supported values from 0 to 5. 0 for general useful logs, # 5 for trace level verbosity.