| Giorgi Lekveishvili | b38f736 | 2023-06-05 13:36:02 +0400 | [diff] [blame] | 1 | {{- if .Values.linux.enabled}} |
| 2 | kind: DaemonSet |
| 3 | apiVersion: apps/v1 |
| 4 | metadata: |
| 5 | name: {{ .Values.linux.dsName }} |
| 6 | namespace: {{ .Release.Namespace }} |
| 7 | {{ include "smb.labels" . | indent 2 }} |
| 8 | spec: |
| 9 | updateStrategy: |
| 10 | rollingUpdate: |
| 11 | maxUnavailable: {{ .Values.node.maxUnavailable }} |
| 12 | type: RollingUpdate |
| 13 | selector: |
| 14 | matchLabels: |
| 15 | app: {{ .Values.linux.dsName }} |
| 16 | template: |
| 17 | metadata: |
| 18 | {{ include "smb.labels" . | indent 6 }} |
| 19 | app: {{ .Values.linux.dsName }} |
| 20 | {{- if .Values.podLabels }} |
| 21 | {{- toYaml .Values.podLabels | nindent 8 }} |
| 22 | {{- end }} |
| 23 | {{- if .Values.podAnnotations }} |
| 24 | annotations: |
| 25 | {{ toYaml .Values.podAnnotations | indent 8 }} |
| 26 | {{- end }} |
| 27 | spec: |
| 28 | {{- with .Values.node.affinity }} |
| 29 | affinity: |
| 30 | {{ toYaml . | indent 8 }} |
| 31 | {{- end }} |
| 32 | hostNetwork: true |
| 33 | dnsPolicy: {{ .Values.linux.dnsPolicy }} |
| 34 | serviceAccountName: {{ .Values.serviceAccount.node }} |
| 35 | nodeSelector: |
| 36 | kubernetes.io/os: linux |
| 37 | {{- with .Values.node.nodeSelector }} |
| 38 | {{ toYaml . | indent 8 }} |
| 39 | {{- end }} |
| 40 | priorityClassName: {{ .Values.priorityClassName | quote }} |
| 41 | {{- if .Values.securityContext }} |
| 42 | securityContext: {{- toYaml .Values.securityContext | nindent 8 }} |
| 43 | {{- end }} |
| 44 | {{- with .Values.linux.tolerations }} |
| 45 | tolerations: |
| 46 | {{ toYaml . | indent 8 }} |
| 47 | {{- end }} |
| 48 | {{- include "smb.pullSecrets" . | indent 6 }} |
| 49 | containers: |
| 50 | - name: liveness-probe |
| 51 | volumeMounts: |
| 52 | - mountPath: /csi |
| 53 | name: socket-dir |
| 54 | {{- if hasPrefix "/" .Values.image.livenessProbe.repository }} |
| 55 | image: "{{ .Values.image.baseRepo }}{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 56 | {{- else }} |
| 57 | image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 58 | {{- end }} |
| 59 | args: |
| 60 | - --csi-address=/csi/csi.sock |
| 61 | - --probe-timeout=3s |
| 62 | - --health-port={{ .Values.node.livenessProbe.healthPort }} |
| 63 | - --v=2 |
| 64 | imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }} |
| 65 | resources: {{- toYaml .Values.linux.resources.livenessProbe | nindent 12 }} |
| 66 | securityContext: |
| 67 | readOnlyRootFilesystem: true |
| 68 | - name: node-driver-registrar |
| 69 | {{- if hasPrefix "/" .Values.image.nodeDriverRegistrar.repository }} |
| 70 | image: "{{ .Values.image.baseRepo }}{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}" |
| 71 | {{- else }} |
| 72 | image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}" |
| 73 | {{- end }} |
| 74 | args: |
| 75 | - --csi-address=$(ADDRESS) |
| 76 | - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) |
| 77 | - --v=2 |
| 78 | livenessProbe: |
| 79 | exec: |
| 80 | command: |
| 81 | - /csi-node-driver-registrar |
| 82 | - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) |
| 83 | - --mode=kubelet-registration-probe |
| 84 | initialDelaySeconds: 30 |
| 85 | timeoutSeconds: 15 |
| 86 | env: |
| 87 | - name: ADDRESS |
| 88 | value: /csi/csi.sock |
| 89 | - name: DRIVER_REG_SOCK_PATH |
| 90 | value: {{ .Values.linux.kubelet }}/plugins/{{ .Values.driver.name }}/csi.sock |
| 91 | imagePullPolicy: {{ .Values.image.nodeDriverRegistrar.pullPolicy }} |
| 92 | volumeMounts: |
| 93 | - name: socket-dir |
| 94 | mountPath: /csi |
| 95 | - name: registration-dir |
| 96 | mountPath: /registration |
| 97 | resources: {{- toYaml .Values.linux.resources.nodeDriverRegistrar | nindent 12 }} |
| 98 | - name: smb |
| 99 | {{- if hasPrefix "/" .Values.image.smb.repository }} |
| 100 | image: "{{ .Values.image.baseRepo }}{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}" |
| 101 | {{- else }} |
| 102 | image: "{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}" |
| 103 | {{- end }} |
| 104 | imagePullPolicy: {{ .Values.image.smb.pullPolicy }} |
| 105 | args: |
| 106 | - "--v={{ .Values.node.logLevel }}" |
| 107 | - "--drivername={{ .Values.driver.name }}" |
| 108 | - "--endpoint=$(CSI_ENDPOINT)" |
| 109 | - "--nodeid=$(KUBE_NODE_NAME)" |
| 110 | - "--enable-get-volume-stats={{ .Values.feature.enableGetVolumeStats }}" |
| 111 | ports: |
| 112 | - containerPort: {{ .Values.node.livenessProbe.healthPort }} |
| 113 | name: healthz |
| 114 | protocol: TCP |
| 115 | livenessProbe: |
| 116 | failureThreshold: 5 |
| 117 | httpGet: |
| 118 | path: /healthz |
| 119 | port: healthz |
| 120 | initialDelaySeconds: 30 |
| 121 | timeoutSeconds: 10 |
| 122 | periodSeconds: 30 |
| 123 | env: |
| 124 | - name: CSI_ENDPOINT |
| 125 | value: unix:///csi/csi.sock |
| 126 | - name: KUBE_NODE_NAME |
| 127 | valueFrom: |
| 128 | fieldRef: |
| 129 | apiVersion: v1 |
| 130 | fieldPath: spec.nodeName |
| 131 | securityContext: |
| 132 | readOnlyRootFilesystem: true |
| 133 | privileged: true |
| 134 | volumeMounts: |
| 135 | - mountPath: /csi |
| 136 | name: socket-dir |
| 137 | - mountPath: {{ .Values.linux.kubelet }}/ |
| 138 | mountPropagation: Bidirectional |
| 139 | name: mountpoint-dir |
| 140 | resources: {{- toYaml .Values.linux.resources.smb | nindent 12 }} |
| 141 | volumes: |
| 142 | - hostPath: |
| 143 | path: {{ .Values.linux.kubelet }}/plugins/{{ .Values.driver.name }} |
| 144 | type: DirectoryOrCreate |
| 145 | name: socket-dir |
| 146 | - hostPath: |
| 147 | path: {{ .Values.linux.kubelet }}/ |
| 148 | type: DirectoryOrCreate |
| 149 | name: mountpoint-dir |
| 150 | - hostPath: |
| 151 | path: {{ .Values.linux.kubelet }}/plugins_registry/ |
| 152 | type: DirectoryOrCreate |
| 153 | name: registration-dir |
| 154 | {{- end -}} |