add if condition for attacher

adding the condition will help us
to easily remove the attacher later.
or even we can add else condition
if we have an alternate to attacher.

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
This commit is contained in:
Madhu Rajanna 2019-04-02 16:51:42 +05:30
parent 54d52bb411
commit c6b4e47723
6 changed files with 10 additions and 2 deletions

View File

@ -34,7 +34,9 @@ rules:
- apiGroups: [""]
resources: ["nodes"]
verbs: ["get", "list", "watch"]
{{ if .Values.attacher.enabled }}
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
{{ end }}
{{- end -}}

View File

@ -41,6 +41,7 @@ spec:
mountPath: {{ .Values.socketDir }}
resources:
{{ toYaml .Values.provisioner.resources | indent 12 }}
{{ if .Values.attacher.enabled }}
- name: csi-attacher
image: "{{ .Values.attacher.image.repository }}:{{ .Values.attacher.image.tag }}"
args:
@ -53,6 +54,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: {{ .Values.socketDir }}
{{ end }}
- name: csi-cephfsplugin
securityContext:
privileged: true

View File

@ -20,7 +20,7 @@ volumeDevicesDir: /var/lib/kubelet/plugins/kubernetes.io/csi/volumeDevices
driverName: cephfs.csi.ceph.com
attacher:
name: attacher
enabled: true
replicaCount: 1
image:

View File

@ -34,9 +34,11 @@ rules:
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshots"]
verbs: ["get", "list", "watch", "update"]
{{ if .Values.attacher.enabled }}
- apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"]
{{ end }}
- apiGroups: ["snapshot.storage.k8s.io"]
resources: ["volumesnapshotcontents"]
verbs: ["create", "get", "list", "watch", "update", "delete"]

View File

@ -58,6 +58,7 @@ spec:
mountPath: {{ .Values.socketDir }}
resources:
{{ toYaml .Values.snapshotter.resources | indent 12 }}
{{ if .Values.attacher.enabled }}
- name: csi-attacher
image: "{{ .Values.attacher.image.repository }}:{{ .Values.attacher.image.tag }}"
args:
@ -70,6 +71,7 @@ spec:
volumeMounts:
- name: socket-dir
mountPath: {{ .Values.socketDir }}
{{ end }}
- name: csi-rbdplugin
securityContext:
privileged: true

View File

@ -21,7 +21,7 @@ driverName: rbd.csi.ceph.com
attacher:
name: attacher
enabled: true
replicaCount: 1
image: