|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: DaemonSet |
| 3 | +metadata: |
| 4 | + name: {{ include "harvester-csi-driver.name" . }} |
| 5 | + namespace: {{ .Release.Namespace }} |
| 6 | + labels: |
| 7 | + {{- include "harvester-csi-driver.labels" . | nindent 4 }} |
| 8 | +spec: |
| 9 | + selector: |
| 10 | + matchLabels: |
| 11 | + component: csi-driver |
| 12 | + {{- include "harvester-csi-driver.selectorLabels" . | nindent 6 }} |
| 13 | + template: |
| 14 | + metadata: |
| 15 | + labels: |
| 16 | + component: csi-driver |
| 17 | + {{- include "harvester-csi-driver.selectorLabels" . | nindent 8 }} |
| 18 | + spec: |
| 19 | + containers: |
| 20 | + - args: |
| 21 | + - --v=5 |
| 22 | + - --csi-address=$(ADDRESS) |
| 23 | + - --kubelet-registration-path={{ .Values.kubeletRootDir }}/harvester-plugins/driver.harvesterhci.io/csi.sock |
| 24 | + env: |
| 25 | + - name: ADDRESS |
| 26 | + value: /csi/csi.sock |
| 27 | + image: {{ template "system_default_registry" . }}{{ .Values.image.csi.nodeDriverRegistrar.repository }}:{{ .Values.image.csi.nodeDriverRegistrar.tag }} |
| 28 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 29 | + lifecycle: |
| 30 | + preStop: |
| 31 | + exec: |
| 32 | + command: |
| 33 | + - /bin/sh |
| 34 | + - -c |
| 35 | + - rm -rf /registration/driver.harvesterhci.io-reg.sock |
| 36 | + /csi//* |
| 37 | + name: node-driver-registrar |
| 38 | + securityContext: |
| 39 | + privileged: true |
| 40 | + volumeMounts: |
| 41 | + - mountPath: /csi/ |
| 42 | + name: socket-dir |
| 43 | + - mountPath: /registration |
| 44 | + name: registration-dir |
| 45 | + - args: |
| 46 | + - --nodeid=$(NODE_ID) |
| 47 | + - --endpoint=$(CSI_ENDPOINT) |
| 48 | + - --kubeconfig=/var/lib/harvester/cloud-provider-config |
| 49 | + {{- if .Values.hostStorageClass }} |
| 50 | + - --host-storage-class={{ .Values.hostStorageClass }} |
| 51 | + {{- end }} |
| 52 | + env: |
| 53 | + - name: NODE_ID |
| 54 | + valueFrom: |
| 55 | + fieldRef: |
| 56 | + apiVersion: v1 |
| 57 | + fieldPath: spec.nodeName |
| 58 | + - name: CSI_ENDPOINT |
| 59 | + value: unix:///csi/csi.sock |
| 60 | + image: {{ template "system_default_registry" . }}{{ .Values.image.harvester.csiDriver.repository }}:{{ .Values.image.harvester.csiDriver.tag | default .Chart.AppVersion }} |
| 61 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 62 | + lifecycle: |
| 63 | + preStop: |
| 64 | + exec: |
| 65 | + command: |
| 66 | + - /bin/sh |
| 67 | + - -c |
| 68 | + - rm -f /csi//* |
| 69 | + name: harvester-csi-driver |
| 70 | + securityContext: |
| 71 | + allowPrivilegeEscalation: true |
| 72 | + capabilities: |
| 73 | + add: |
| 74 | + - SYS_ADMIN |
| 75 | + privileged: true |
| 76 | + volumeMounts: |
| 77 | + - name: cloud-config |
| 78 | + readOnly: true |
| 79 | + mountPath: /var/lib/harvester |
| 80 | + - name: kubernetes |
| 81 | + readOnly: true |
| 82 | + mountPath: /etc/kubernetes |
| 83 | + - mountPath: {{ .Values.kubeletRootDir }}/plugins/kubernetes.io/csi |
| 84 | + mountPropagation: Bidirectional |
| 85 | + name: kubernetes-csi-dir |
| 86 | + - mountPath: /csi/ |
| 87 | + name: socket-dir |
| 88 | + - mountPath: {{ .Values.kubeletRootDir }}/pods |
| 89 | + mountPropagation: Bidirectional |
| 90 | + name: pods-mount-dir |
| 91 | + - mountPath: /dev |
| 92 | + name: host-dev |
| 93 | + - mountPath: /sys |
| 94 | + name: host-sys |
| 95 | + - mountPath: /rootfs |
| 96 | + mountPropagation: Bidirectional |
| 97 | + name: host |
| 98 | + - mountPath: /lib/modules |
| 99 | + name: lib-modules |
| 100 | + readOnly: true |
| 101 | + hostPID: true |
| 102 | + serviceAccountName: {{ include "harvester-csi-driver.name" . }} |
| 103 | + {{- with .Values.nodeSelector }} |
| 104 | + nodeSelector: |
| 105 | + {{- toYaml . | nindent 8 }} |
| 106 | + {{- end }} |
| 107 | + {{- with .Values.tolerations }} |
| 108 | + tolerations: |
| 109 | + {{- toYaml . | nindent 8 }} |
| 110 | + {{- end }} |
| 111 | + volumes: |
| 112 | + - name: cloud-config |
| 113 | + {{- if .Values.cloudConfig.secretName }} |
| 114 | + secret: |
| 115 | + secretName: {{ .Values.cloudConfig.secretName }} |
| 116 | + {{- else }} |
| 117 | + hostPath: |
| 118 | + path: {{ .Values.cloudConfig.hostPath }} |
| 119 | + type: DirectoryOrCreate |
| 120 | + {{- end }} |
| 121 | + - hostPath: |
| 122 | + path: /etc/kubernetes |
| 123 | + type: DirectoryOrCreate |
| 124 | + name: kubernetes |
| 125 | + - hostPath: |
| 126 | + path: {{ .Values.kubeletRootDir }}/plugins/kubernetes.io/csi |
| 127 | + type: DirectoryOrCreate |
| 128 | + name: kubernetes-csi-dir |
| 129 | + - hostPath: |
| 130 | + path: {{ .Values.kubeletRootDir }}/plugins_registry |
| 131 | + type: Directory |
| 132 | + name: registration-dir |
| 133 | + - hostPath: |
| 134 | + path: {{ .Values.kubeletRootDir }}/harvester-plugins/driver.harvesterhci.io |
| 135 | + type: DirectoryOrCreate |
| 136 | + name: socket-dir |
| 137 | + - hostPath: |
| 138 | + path: {{ .Values.kubeletRootDir }}/pods |
| 139 | + type: DirectoryOrCreate |
| 140 | + name: pods-mount-dir |
| 141 | + - hostPath: |
| 142 | + path: /dev |
| 143 | + name: host-dev |
| 144 | + - hostPath: |
| 145 | + path: /sys |
| 146 | + name: host-sys |
| 147 | + - hostPath: |
| 148 | + path: / |
| 149 | + name: host |
| 150 | + - hostPath: |
| 151 | + path: /lib/modules |
| 152 | + name: lib-modules |
0 commit comments