From 55d627c978e665556f8f2f9a3fb3c9ca289f17bc Mon Sep 17 00:00:00 2001 From: Farnaz Babaeian Date: Mon, 8 Apr 2024 12:26:17 +0200 Subject: [PATCH 1/4] Make all component selective --- charts/cloudstack-csi/templates/csi-clusterrole.yaml | 2 ++ charts/cloudstack-csi/templates/csi-clusterrolebinding.yaml | 2 ++ charts/cloudstack-csi/templates/csi-controller-deploy.yaml | 4 +++- charts/cloudstack-csi/templates/csi-driver.yaml | 2 ++ charts/cloudstack-csi/templates/csi-node-ds.yaml | 4 +++- charts/cloudstack-csi/templates/syncer-job.yaml | 5 ++++- charts/cloudstack-csi/templates/syncer-rbac.yaml | 2 ++ 7 files changed, 18 insertions(+), 3 deletions(-) diff --git a/charts/cloudstack-csi/templates/csi-clusterrole.yaml b/charts/cloudstack-csi/templates/csi-clusterrole.yaml index b234dcd..e691846 100644 --- a/charts/cloudstack-csi/templates/csi-clusterrole.yaml +++ b/charts/cloudstack-csi/templates/csi-clusterrole.yaml @@ -1,3 +1,4 @@ +{{ if .Values.controller.enabled }} {{ if .Values.rbac.create }} # This YAML file contains Cluster Role objects, # which are necessary to run cloudstack-csi-controller @@ -105,4 +106,5 @@ rules: resources: [leases] verbs: ["get", "watch", "list", "delete", "update", "create"] {{- end}} +{{- end}} {{- end}} \ No newline at end of file diff --git a/charts/cloudstack-csi/templates/csi-clusterrolebinding.yaml b/charts/cloudstack-csi/templates/csi-clusterrolebinding.yaml index 03b068f..4420bc8 100644 --- a/charts/cloudstack-csi/templates/csi-clusterrolebinding.yaml +++ b/charts/cloudstack-csi/templates/csi-clusterrolebinding.yaml @@ -1,3 +1,4 @@ +{{ if .Values.controller.enabled }} {{ if .Values.rbac.create }} # This YAML file contains Cluster Role Binding objects, # which are necessary to run cloudstack-csi-controller @@ -52,4 +53,5 @@ roleRef: kind: ClusterRole name: csi-resizer-role apiGroup: rbac.authorization.k8s.io +{{- end}} {{- end}} \ No newline at end of file diff --git a/charts/cloudstack-csi/templates/csi-controller-deploy.yaml b/charts/cloudstack-csi/templates/csi-controller-deploy.yaml index f9d96a1..c525664 100644 --- a/charts/cloudstack-csi/templates/csi-controller-deploy.yaml +++ b/charts/cloudstack-csi/templates/csi-controller-deploy.yaml @@ -1,3 +1,4 @@ +{{ if .Values.controller.enabled }} {{ $enableLeaderElection := gt (int .Values.controller.replicaCount) 1 }} apiVersion: apps/v1 @@ -212,4 +213,5 @@ spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} \ No newline at end of file + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/cloudstack-csi/templates/csi-driver.yaml b/charts/cloudstack-csi/templates/csi-driver.yaml index 9dbc49f..323eaa5 100644 --- a/charts/cloudstack-csi/templates/csi-driver.yaml +++ b/charts/cloudstack-csi/templates/csi-driver.yaml @@ -1,3 +1,4 @@ +{{- if or (.Values.controller.enabled) (.Values.node.enabled) }} apiVersion: storage.k8s.io/v1 kind: CSIDriver metadata: @@ -12,3 +13,4 @@ spec: # Supports only persistent volumes. volumeLifecycleModes: - Persistent +{{- end }} diff --git a/charts/cloudstack-csi/templates/csi-node-ds.yaml b/charts/cloudstack-csi/templates/csi-node-ds.yaml index a5b453e..70c2d84 100644 --- a/charts/cloudstack-csi/templates/csi-node-ds.yaml +++ b/charts/cloudstack-csi/templates/csi-node-ds.yaml @@ -1,3 +1,4 @@ +{{ if .Values.node.enabled }} --- apiVersion: apps/v1 kind: DaemonSet @@ -177,4 +178,5 @@ spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} - {{- end }} \ No newline at end of file + {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/cloudstack-csi/templates/syncer-job.yaml b/charts/cloudstack-csi/templates/syncer-job.yaml index a264b02..0009b95 100644 --- a/charts/cloudstack-csi/templates/syncer-job.yaml +++ b/charts/cloudstack-csi/templates/syncer-job.yaml @@ -1,3 +1,5 @@ + +{{ if .Values.syncer.enabled }} --- apiVersion: batch/v1 kind: Job @@ -46,4 +48,5 @@ spec: {{- end }} affinity: {{ toYaml .Values.syncer.affinity | nindent 8 }} nodeSelector: {{ toYaml .Values.syncer.nodeSelector | nindent 8 }} - restartPolicy: {{ .Values.syncer.restartPolicy }} \ No newline at end of file + restartPolicy: {{ .Values.syncer.restartPolicy }} +{{- end }} \ No newline at end of file diff --git a/charts/cloudstack-csi/templates/syncer-rbac.yaml b/charts/cloudstack-csi/templates/syncer-rbac.yaml index 9d12df2..a9b534d 100644 --- a/charts/cloudstack-csi/templates/syncer-rbac.yaml +++ b/charts/cloudstack-csi/templates/syncer-rbac.yaml @@ -1,3 +1,4 @@ +{{ if .Values.syncer.enabled }} {{ if .Values.syncer.rbac.create }} --- apiVersion: v1 @@ -39,4 +40,5 @@ roleRef: kind: ClusterRole name: csi-sc-syncer-role apiGroup: rbac.authorization.k8s.io +{{- end }} {{- end }} \ No newline at end of file From 1bfe7b79b8d6918206470b69d5daec7100852edd Mon Sep 17 00:00:00 2001 From: Farnaz Babaeian Date: Mon, 8 Apr 2024 12:26:31 +0200 Subject: [PATCH 2/4] Add dns policy for NogeAgents --- charts/cloudstack-csi/values.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/charts/cloudstack-csi/values.yaml b/charts/cloudstack-csi/values.yaml index 07db1ec..edb2f40 100644 --- a/charts/cloudstack-csi/values.yaml +++ b/charts/cloudstack-csi/values.yaml @@ -18,6 +18,7 @@ podMonitor: ## CloudStack CSI Controller Defaults controller: + enabled: true attacher: image: repository: registry.k8s.io/sig-storage/csi-attacher @@ -93,6 +94,7 @@ controller: ## CloudStack CSI Node Defaults node: + enabled: true nodeDriverRegistrar: image: repository: registry.k8s.io/sig-storage/csi-node-driver-registrar @@ -115,6 +117,7 @@ node: - name: cacert hostPath: path: /etc/cacert + dnsPolicy: ClusterFirstWithHostNet podSecurityContext: {} @@ -142,6 +145,7 @@ node: ## CloudStack Storage Class Synecr Job Defaults syncer: + enabled: true # Job image image: repository: "ghcr.io/leaseweb/cloudstack-csi-sc-syncer" From c805c587c440b68f20775804667b3aa73147110f Mon Sep 17 00:00:00 2001 From: Farnaz Babaeian Date: Mon, 8 Apr 2024 12:34:15 +0200 Subject: [PATCH 3/4] Upgrade to latest version --- charts/cloudstack-csi/values.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/cloudstack-csi/values.yaml b/charts/cloudstack-csi/values.yaml index edb2f40..49b73d8 100644 --- a/charts/cloudstack-csi/values.yaml +++ b/charts/cloudstack-csi/values.yaml @@ -45,7 +45,7 @@ controller: image: repository: ghcr.io/leaseweb/cloudstack-csi-driver pullPolicy: IfNotPresent - tag: 0.3.0 # defaults to .Chart.AppVersion + # tag: 0.4.1 # defaults to .Chart.AppVersion volumeMounts: - name: cacert mountPath: /etc/cacert @@ -106,7 +106,7 @@ node: image: repository: ghcr.io/leaseweb/cloudstack-csi-driver pullPolicy: IfNotPresent - tag: 0.3.0 # defaults to .Chart.AppVersion + # tag: 0.4.1 # defaults to .Chart.AppVersion resources: {} extraArgs: {} volumeMounts: @@ -149,7 +149,7 @@ syncer: # Job image image: repository: "ghcr.io/leaseweb/cloudstack-csi-sc-syncer" - tag: "0.3.0" # defaults to .Chart.AppVersion + # tag: "0.4.1" # defaults to .Chart.AppVersion imagePullPolicy: IfNotPresent extraArgs: {} From 546ae623626577f5ab00649d152f24f3d43772b4 Mon Sep 17 00:00:00 2001 From: Farnaz Babaeian Date: Mon, 8 Apr 2024 12:41:57 +0200 Subject: [PATCH 4/4] New chart version --- charts/cloudstack-csi/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/cloudstack-csi/Chart.yaml b/charts/cloudstack-csi/Chart.yaml index 380c00f..3a4325a 100644 --- a/charts/cloudstack-csi/Chart.yaml +++ b/charts/cloudstack-csi/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: cloudstack-csi description: A Helm chart for Kubernetes type: application -version: 1.0.2 +version: 1.0.3 appVersion: 0.4.1 sources: - https://github.com/Leaseweb/cloudstack-csi-driver