Skip to content

Commit 55d627c

Browse files
committed
Make all component selective
1 parent 41b72a8 commit 55d627c

7 files changed

Lines changed: 18 additions & 3 deletions

File tree

charts/cloudstack-csi/templates/csi-clusterrole.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if .Values.controller.enabled }}
12
{{ if .Values.rbac.create }}
23
# This YAML file contains Cluster Role objects,
34
# which are necessary to run cloudstack-csi-controller
@@ -105,4 +106,5 @@ rules:
105106
resources: [leases]
106107
verbs: ["get", "watch", "list", "delete", "update", "create"]
107108
{{- end}}
109+
{{- end}}
108110
{{- end}}

charts/cloudstack-csi/templates/csi-clusterrolebinding.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if .Values.controller.enabled }}
12
{{ if .Values.rbac.create }}
23
# This YAML file contains Cluster Role Binding objects,
34
# which are necessary to run cloudstack-csi-controller
@@ -52,4 +53,5 @@ roleRef:
5253
kind: ClusterRole
5354
name: csi-resizer-role
5455
apiGroup: rbac.authorization.k8s.io
56+
{{- end}}
5557
{{- end}}

charts/cloudstack-csi/templates/csi-controller-deploy.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if .Values.controller.enabled }}
12
{{ $enableLeaderElection := gt (int .Values.controller.replicaCount) 1 }}
23

34
apiVersion: apps/v1
@@ -212,4 +213,5 @@ spec:
212213
{{- with .Values.imagePullSecrets }}
213214
imagePullSecrets:
214215
{{- toYaml . | nindent 8 }}
215-
{{- end }}
216+
{{- end }}
217+
{{- end }}

charts/cloudstack-csi/templates/csi-driver.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{- if or (.Values.controller.enabled) (.Values.node.enabled) }}
12
apiVersion: storage.k8s.io/v1
23
kind: CSIDriver
34
metadata:
@@ -12,3 +13,4 @@ spec:
1213
# Supports only persistent volumes.
1314
volumeLifecycleModes:
1415
- Persistent
16+
{{- end }}

charts/cloudstack-csi/templates/csi-node-ds.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if .Values.node.enabled }}
12
---
23
apiVersion: apps/v1
34
kind: DaemonSet
@@ -177,4 +178,5 @@ spec:
177178
{{- with .Values.imagePullSecrets }}
178179
imagePullSecrets:
179180
{{- toYaml . | nindent 8 }}
180-
{{- end }}
181+
{{- end }}
182+
{{- end }}

charts/cloudstack-csi/templates/syncer-job.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
{{ if .Values.syncer.enabled }}
13
---
24
apiVersion: batch/v1
35
kind: Job
@@ -46,4 +48,5 @@ spec:
4648
{{- end }}
4749
affinity: {{ toYaml .Values.syncer.affinity | nindent 8 }}
4850
nodeSelector: {{ toYaml .Values.syncer.nodeSelector | nindent 8 }}
49-
restartPolicy: {{ .Values.syncer.restartPolicy }}
51+
restartPolicy: {{ .Values.syncer.restartPolicy }}
52+
{{- end }}

charts/cloudstack-csi/templates/syncer-rbac.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
{{ if .Values.syncer.enabled }}
12
{{ if .Values.syncer.rbac.create }}
23
---
34
apiVersion: v1
@@ -39,4 +40,5 @@ roleRef:
3940
kind: ClusterRole
4041
name: csi-sc-syncer-role
4142
apiGroup: rbac.authorization.k8s.io
43+
{{- end }}
4244
{{- end }}

0 commit comments

Comments
 (0)