Skip to content

Commit 57fe96c

Browse files
committed
cinder-csi: make csi-snapshotter sidecar optional
The csi-snapshotter sidecar is always deployed regardless of whether the VolumeSnapshot CRDs are installed. On clusters without the external-snapshotter CRDs, this produces continuous error logs from the sidecar attempting to list VolumeSnapshotContent resources that don't exist. Add csi.snapshotter.enabled (default true for backward compatibility) to gate the snapshotter container and its RBAC resources.
1 parent a031201 commit 57fe96c

3 files changed

Lines changed: 5 additions & 0 deletions

File tree

charts/cinder-csi-plugin/templates/controllerplugin-deployment.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ spec:
8686
- name: socket-dir
8787
mountPath: /var/lib/csi/sockets/pluginproxy/
8888
resources: {{ toYaml .Values.csi.provisioner.resources | nindent 12 }}
89+
{{- if .Values.csi.snapshotter.enabled }}
8990
- name: csi-snapshotter
9091
securityContext:
9192
{{- toYaml .Values.csi.plugin.controllerPlugin.securityContext | nindent 12 }}
@@ -111,6 +112,7 @@ spec:
111112
- mountPath: /var/lib/csi/sockets/pluginproxy/
112113
name: socket-dir
113114
resources: {{ toYaml .Values.csi.snapshotter.resources | nindent 12 }}
115+
{{- end }}
114116
- name: csi-resizer
115117
securityContext:
116118
{{- toYaml .Values.csi.plugin.controllerPlugin.securityContext | nindent 12 }}

charts/cinder-csi-plugin/templates/controllerplugin-rbac.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ roleRef:
8888
name: csi-provisioner-role
8989
apiGroup: rbac.authorization.k8s.io
9090

91+
{{- if .Values.csi.snapshotter.enabled }}
9192
---
9293
kind: ClusterRole
9394
apiVersion: rbac.authorization.k8s.io/v1
@@ -125,6 +126,7 @@ roleRef:
125126
kind: ClusterRole
126127
name: csi-snapshotter-role
127128
apiGroup: rbac.authorization.k8s.io
129+
{{- end }}
128130
---
129131
kind: ClusterRole
130132
apiVersion: rbac.authorization.k8s.io/v1

charts/cinder-csi-plugin/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ csi:
2323
extraArgs: {}
2424
extraEnv: []
2525
snapshotter:
26+
enabled: true
2627
image:
2728
repository: registry.k8s.io/sig-storage/csi-snapshotter
2829
tag: v8.4.0

0 commit comments

Comments
 (0)