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: [""] - apiGroups: [""]
resources: ["nodes"] resources: ["nodes"]
verbs: ["get", "list", "watch"] verbs: ["get", "list", "watch"]
{{ if .Values.attacher.enabled }}
- apiGroups: ["storage.k8s.io"] - apiGroups: ["storage.k8s.io"]
resources: ["volumeattachments"] resources: ["volumeattachments"]
verbs: ["get", "list", "watch", "update"] verbs: ["get", "list", "watch", "update"]
{{ end }}
{{- end -}} {{- end -}}

View File

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

View File

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

View File

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

View File

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

View File

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