|
| 1 | +apiVersion: v1 |
| 2 | +kind: ServiceAccount |
| 3 | +metadata: |
| 4 | + name: csi-s3 |
| 5 | + labels: |
| 6 | + {{- include "csi-s3.labels" . | nindent 4 }} |
| 7 | + {{- with .Values.serviceAccount.annotations }} |
| 8 | + annotations: |
| 9 | + {{- toYaml . | nindent 4 }} |
| 10 | + {{- end }} |
| 11 | +--- |
| 12 | +kind: ClusterRole |
| 13 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 14 | +metadata: |
| 15 | + name: csi-s3 |
| 16 | + labels: |
| 17 | + {{- include "csi-s3.labels" . | nindent 4 }} |
| 18 | +rules: |
| 19 | + - apiGroups: [""] |
| 20 | + resources: ["secrets"] |
| 21 | + verbs: ["get", "list"] |
| 22 | + - apiGroups: [""] |
| 23 | + resources: ["nodes"] |
| 24 | + verbs: ["get", "list", "update"] |
| 25 | + - apiGroups: [""] |
| 26 | + resources: ["namespaces"] |
| 27 | + verbs: ["get", "list"] |
| 28 | + - apiGroups: [""] |
| 29 | + resources: ["persistentvolumes"] |
| 30 | + verbs: ["get", "list", "watch", "update"] |
| 31 | + - apiGroups: ["storage.k8s.io"] |
| 32 | + resources: ["volumeattachments"] |
| 33 | + verbs: ["get", "list", "watch", "update"] |
| 34 | +--- |
| 35 | +kind: ClusterRoleBinding |
| 36 | +apiVersion: rbac.authorization.k8s.io/v1 |
| 37 | +metadata: |
| 38 | + name: csi-s3 |
| 39 | + labels: |
| 40 | + {{- include "csi-s3.labels" . | nindent 4 }} |
| 41 | +subjects: |
| 42 | + - kind: ServiceAccount |
| 43 | + name: csi-s3 |
| 44 | + namespace: "{{ .Release.Namespace }}" |
| 45 | +roleRef: |
| 46 | + kind: ClusterRole |
| 47 | + name: csi-s3 |
| 48 | + apiGroup: rbac.authorization.k8s.io |
| 49 | +--- |
| 50 | +kind: DaemonSet |
| 51 | +apiVersion: apps/v1 |
| 52 | +metadata: |
| 53 | + name: csi-s3 |
| 54 | + labels: |
| 55 | + {{- include "csi-s3.labels" . | nindent 4 }} |
| 56 | +spec: |
| 57 | + selector: |
| 58 | + matchLabels: |
| 59 | + {{- include "csi-s3.selectorLabels" . | nindent 6 }} |
| 60 | + app: csi-s3 |
| 61 | + template: |
| 62 | + metadata: |
| 63 | + labels: |
| 64 | + {{- include "csi-s3.selectorLabels" . | nindent 8 }} |
| 65 | + app: csi-s3 |
| 66 | + spec: |
| 67 | + serviceAccountName: csi-s3 |
| 68 | + hostNetwork: true |
| 69 | + containers: |
| 70 | + - name: driver-registrar |
| 71 | + image: "{{ .Values.registrar.image.repository }}:{{ .Values.registrar.image.tag | default .Chart.AppVersion }}" |
| 72 | + imagePullPolicy: "{{ .Values.registrar.image.pullPolicy }}" |
| 73 | + args: |
| 74 | + - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)" |
| 75 | + - "--v=4" |
| 76 | + - "--csi-address=$(ADDRESS)" |
| 77 | + env: |
| 78 | + - name: ADDRESS |
| 79 | + value: /csi/csi.sock |
| 80 | + - name: DRIVER_REG_SOCK_PATH |
| 81 | + value: /var/lib/kubelet/plugins/ch.ctrox.csi.s3-driver/csi.sock |
| 82 | + - name: KUBE_NODE_NAME |
| 83 | + valueFrom: |
| 84 | + fieldRef: |
| 85 | + fieldPath: spec.nodeName |
| 86 | + volumeMounts: |
| 87 | + - name: plugin-dir |
| 88 | + mountPath: /csi |
| 89 | + - name: registration-dir |
| 90 | + mountPath: /registration/ |
| 91 | + - name: csi-s3 |
| 92 | + image: "{{ .Values.csi.image.repository }}:{{ .Values.csi.image.tag | default .Chart.AppVersion }}" |
| 93 | + imagePullPolicy: "{{ .Values.csi.image.pullPolicy }}" |
| 94 | + securityContext: |
| 95 | + privileged: true |
| 96 | + capabilities: |
| 97 | + add: ["SYS_ADMIN"] |
| 98 | + allowPrivilegeEscalation: true |
| 99 | + args: |
| 100 | + - "--endpoint=$(CSI_ENDPOINT)" |
| 101 | + - "--nodeid=$(NODE_ID)" |
| 102 | + - "--v=4" |
| 103 | + env: |
| 104 | + - name: CSI_ENDPOINT |
| 105 | + value: unix:///csi/csi.sock |
| 106 | + - name: NODE_ID |
| 107 | + valueFrom: |
| 108 | + fieldRef: |
| 109 | + fieldPath: spec.nodeName |
| 110 | + volumeMounts: |
| 111 | + - name: plugin-dir |
| 112 | + mountPath: /csi |
| 113 | + - name: pods-mount-dir |
| 114 | + mountPath: /var/lib/kubelet/pods |
| 115 | + mountPropagation: "Bidirectional" |
| 116 | + - name: fuse-device |
| 117 | + mountPath: /dev/fuse |
| 118 | + volumes: |
| 119 | + - name: registration-dir |
| 120 | + hostPath: |
| 121 | + path: /var/lib/kubelet/plugins_registry/ |
| 122 | + type: DirectoryOrCreate |
| 123 | + - name: plugin-dir |
| 124 | + hostPath: |
| 125 | + path: /var/lib/kubelet/plugins/ch.ctrox.csi.s3-driver |
| 126 | + type: DirectoryOrCreate |
| 127 | + - name: pods-mount-dir |
| 128 | + hostPath: |
| 129 | + path: /var/lib/kubelet/pods |
| 130 | + type: Directory |
| 131 | + - name: fuse-device |
| 132 | + hostPath: |
| 133 | + path: /dev/fuse |
0 commit comments