From dea07aa18471d791ef2e0268bdd2c417e0f8f33e Mon Sep 17 00:00:00 2001 From: "BOSSER, Bastien" Date: Fri, 14 Oct 2022 16:59:09 +0200 Subject: [PATCH] deploy: add commonLabels value Signed-off-by: BOSSER, Bastien --- build.env | 2 +- 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 ++ .../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 + .../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 +++ scripts/install-helm.sh | 4 ++-- 37 files changed, 46 insertions(+), 3 deletions(-) diff --git a/build.env b/build.env index ead3acf6db8..0408e398230 100644 --- a/build.env +++ b/build.env @@ -35,7 +35,7 @@ SNAPSHOT_VERSION=v6.1.0 #GO_COVER_DIR=_output/ # helm chart generation, testing and publishing -HELM_VERSION=v3.9.2 +HELM_VERSION=v3.10.1 # minikube settings MINIKUBE_VERSION=v1.27.0 diff --git a/charts/ceph-csi-cephfs/README.md b/charts/ceph-csi-cephfs/README.md index c1da5898884..1e543c22a22 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 3c8f8a47b10..e8ca33d0259 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 1f59b66cecb..605710c2501 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 1a499bb60cb..f022ed57a98 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 95fee84f2e3..8aaf1260a34 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 5dedaf4b0b8..77b5d5e831a 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 667e7c9231d..6272cf91885 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 82d5d13169e..7417a749179 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 6d3c371cbc5..10feec7ea49 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 5483242421f..92ecca3cea9 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 d5cc575008a..d25814c5bd6 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 66fb7258068..3e77e0aff62 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 c4ba5c1887b..0207133bba6 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 7063543b7b5..64124cb0f69 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 4041dec6be9..a21c998244a 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 f06ccbc5dd8..44ff608050f 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 0f3975671bf..7e8eb4a892e 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 bcd0e4d3947..d2b0b1b4815 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 f0944027e6e..33a0df3c3e2 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 47b7d093d39..f754fea72eb 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 9e24d757ede..aa8ddd4fd6b 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 bf52865e1c5..ec8ad79b3f9 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 aad87542375..fdf85c56fe2 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 68a3942e833..e3b18f59a65 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 36e1ee74594..56bd024ddc4 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 70c7670b2f0..fd3778bd8dd 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 5a086103ab0..d4077daa960 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 f425b174d3c..a7acd13248f 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 0d4c925ecff..10b0e6787ea 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 3a235a36dc3..f0b86fb4032 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 23fa39fed39..62dee476533 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 893b43a9c82..8acf41a24c1 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 1553ceec73a..3040bcfd023 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 fda713ab3a6..a559456aa2b 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 65745773b85..27edd4a5881 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. diff --git a/scripts/install-helm.sh b/scripts/install-helm.sh index cf3a8ad4486..ef71a7c3278 100755 --- a/scripts/install-helm.sh +++ b/scripts/install-helm.sh @@ -169,7 +169,7 @@ install_cephcsi_helm_charts() { fi # install ceph-csi-cephfs and ceph-csi-rbd charts # shellcheck disable=SC2086 - "${HELM}" install --namespace ${NAMESPACE} --set provisioner.fullnameOverride=csi-cephfsplugin-provisioner --set nodeplugin.fullnameOverride=csi-cephfsplugin --set configMapName=ceph-csi-config --set provisioner.replicaCount=1 ${SET_SC_TEMPLATE_VALUES} ${CEPHFS_SECRET_TEMPLATE_VALUES} ${CEPHFS_CHART_NAME} "${SCRIPT_DIR}"/../charts/ceph-csi-cephfs + "${HELM}" install --namespace ${NAMESPACE} --set provisioner.fullnameOverride=csi-cephfsplugin-provisioner --set nodeplugin.fullnameOverride=csi-cephfsplugin --set configMapName=ceph-csi-config --set provisioner.replicaCount=1 --set-json='commonLabels={"app.kubernetes.io/name": "ceph-csi-cephfs", "app.kubernetes.io/managed-by": "helm"}' ${SET_SC_TEMPLATE_VALUES} ${CEPHFS_SECRET_TEMPLATE_VALUES} ${CEPHFS_CHART_NAME} "${SCRIPT_DIR}"/../charts/ceph-csi-cephfs check_deployment_status app=ceph-csi-cephfs ${NAMESPACE} check_daemonset_status app=ceph-csi-cephfs ${NAMESPACE} @@ -179,7 +179,7 @@ install_cephcsi_helm_charts() { kubectl_retry delete cm ceph-config --namespace ${NAMESPACE} # shellcheck disable=SC2086 - "${HELM}" install --namespace ${NAMESPACE} --set provisioner.fullnameOverride=csi-rbdplugin-provisioner --set nodeplugin.fullnameOverride=csi-rbdplugin --set configMapName=ceph-csi-config --set provisioner.replicaCount=1 ${SET_SC_TEMPLATE_VALUES} ${RBD_SECRET_TEMPLATE_VALUES} ${RBD_CHART_NAME} "${SCRIPT_DIR}"/../charts/ceph-csi-rbd --set topology.enabled=true --set topology.domainLabels="{${NODE_LABEL_REGION},${NODE_LABEL_ZONE}}" --set provisioner.maxSnapshotsOnImage=3 --set provisioner.minSnapshotsOnImage=2 + "${HELM}" install --namespace ${NAMESPACE} --set provisioner.fullnameOverride=csi-rbdplugin-provisioner --set nodeplugin.fullnameOverride=csi-rbdplugin --set configMapName=ceph-csi-config --set provisioner.replicaCount=1 --set-json='commonLabels={"app.kubernetes.io/name": "ceph-csi-rbd", "app.kubernetes.io/managed-by": "helm"}' ${SET_SC_TEMPLATE_VALUES} ${RBD_SECRET_TEMPLATE_VALUES} ${RBD_CHART_NAME} "${SCRIPT_DIR}"/../charts/ceph-csi-rbd --set topology.enabled=true --set topology.domainLabels="{${NODE_LABEL_REGION},${NODE_LABEL_ZONE}}" --set provisioner.maxSnapshotsOnImage=3 --set provisioner.minSnapshotsOnImage=2 check_deployment_status app=ceph-csi-rbd ${NAMESPACE} check_daemonset_status app=ceph-csi-rbd ${NAMESPACE}