| Giorgi Lekveishvili | b38f736 | 2023-06-05 13:36:02 +0400 | [diff] [blame] | 1 | {{- if .Values.windows.enabled}} |
| 2 | kind: DaemonSet |
| 3 | apiVersion: apps/v1 |
| 4 | metadata: |
| 5 | name: {{ .Values.windows.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.windows.dsName }} |
| 16 | template: |
| 17 | metadata: |
| 18 | {{ include "smb.labels" . | indent 6 }} |
| 19 | app: {{ .Values.windows.dsName }} |
| 20 | spec: |
| 21 | {{- with .Values.windows.tolerations }} |
| 22 | tolerations: |
| 23 | {{ toYaml . | indent 8 }} |
| 24 | {{- end }} |
| 25 | nodeSelector: |
| 26 | kubernetes.io/os: windows |
| 27 | {{- with .Values.node.nodeSelector }} |
| 28 | {{ toYaml . | indent 8 }} |
| 29 | {{- end }} |
| 30 | {{- with .Values.node.affinity }} |
| 31 | affinity: |
| 32 | {{ toYaml . | indent 8 }} |
| 33 | {{- end }} |
| 34 | priorityClassName: {{ .Values.priorityClassName | quote }} |
| 35 | {{- if .Values.securityContext }} |
| 36 | securityContext: {{- toYaml .Values.securityContext | nindent 8 }} |
| 37 | {{- end }} |
| 38 | serviceAccountName: {{ .Values.serviceAccount.node }} |
| 39 | {{- include "smb.pullSecrets" . | indent 6 }} |
| 40 | containers: |
| 41 | - name: liveness-probe |
| 42 | volumeMounts: |
| 43 | - mountPath: C:\csi |
| 44 | name: plugin-dir |
| 45 | {{- if hasPrefix "/" .Values.image.livenessProbe.repository }} |
| 46 | image: "{{ .Values.image.baseRepo }}{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 47 | {{- else }} |
| 48 | image: "{{ .Values.image.livenessProbe.repository }}:{{ .Values.image.livenessProbe.tag }}" |
| 49 | {{- end }} |
| 50 | args: |
| 51 | - --csi-address=$(CSI_ENDPOINT) |
| 52 | - --probe-timeout=3s |
| 53 | - --health-port={{ .Values.node.livenessProbe.healthPort }} |
| 54 | - --v=2 |
| 55 | env: |
| 56 | - name: CSI_ENDPOINT |
| 57 | value: unix://C:\\csi\\csi.sock |
| 58 | imagePullPolicy: {{ .Values.image.livenessProbe.pullPolicy }} |
| 59 | resources: {{- toYaml .Values.windows.resources.livenessProbe | nindent 12 }} |
| 60 | - name: node-driver-registrar |
| 61 | {{- if hasPrefix "/" .Values.image.nodeDriverRegistrar.repository }} |
| 62 | image: "{{ .Values.image.baseRepo }}{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}" |
| 63 | {{- else }} |
| 64 | image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}" |
| 65 | {{- end }} |
| 66 | args: |
| 67 | - --v=2 |
| 68 | - --csi-address=$(CSI_ENDPOINT) |
| 69 | - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) |
| 70 | livenessProbe: |
| 71 | exec: |
| 72 | command: |
| 73 | - /csi-node-driver-registrar.exe |
| 74 | - --kubelet-registration-path=$(DRIVER_REG_SOCK_PATH) |
| 75 | - --mode=kubelet-registration-probe |
| 76 | initialDelaySeconds: 60 |
| 77 | timeoutSeconds: 30 |
| 78 | env: |
| 79 | - name: CSI_ENDPOINT |
| 80 | value: unix://C:\\csi\\csi.sock |
| 81 | - name: DRIVER_REG_SOCK_PATH |
| 82 | value: {{ .Values.windows.kubelet | replace "\\" "\\\\" }}\\plugins\\{{ .Values.driver.name }}\\csi.sock |
| 83 | - name: KUBE_NODE_NAME |
| 84 | valueFrom: |
| 85 | fieldRef: |
| 86 | fieldPath: spec.nodeName |
| 87 | imagePullPolicy: {{ .Values.image.nodeDriverRegistrar.pullPolicy }} |
| 88 | volumeMounts: |
| 89 | - name: plugin-dir |
| 90 | mountPath: C:\csi |
| 91 | - name: registration-dir |
| 92 | mountPath: C:\registration |
| 93 | resources: {{- toYaml .Values.windows.resources.nodeDriverRegistrar | nindent 12 }} |
| 94 | - name: smb |
| 95 | {{- if hasPrefix "/" .Values.image.smb.repository }} |
| 96 | image: "{{ .Values.image.baseRepo }}{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}" |
| 97 | {{- else }} |
| 98 | image: "{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}" |
| 99 | {{- end }} |
| 100 | imagePullPolicy: {{ .Values.image.smb.pullPolicy }} |
| 101 | args: |
| 102 | - "--v={{ .Values.node.logLevel }}" |
| 103 | - "--drivername={{ .Values.driver.name }}" |
| 104 | - --endpoint=$(CSI_ENDPOINT) |
| 105 | - --nodeid=$(KUBE_NODE_NAME) |
| 106 | - "--enable-get-volume-stats={{ .Values.feature.enableGetVolumeStats }}" |
| 107 | - "--remove-smb-mapping-during-unmount={{ .Values.windows.removeSMBMappingDuringUnmount }}" |
| 108 | ports: |
| 109 | - containerPort: {{ .Values.node.livenessProbe.healthPort }} |
| 110 | name: healthz |
| 111 | protocol: TCP |
| 112 | livenessProbe: |
| 113 | failureThreshold: 5 |
| 114 | httpGet: |
| 115 | path: /healthz |
| 116 | port: healthz |
| 117 | initialDelaySeconds: 30 |
| 118 | timeoutSeconds: 10 |
| 119 | periodSeconds: 30 |
| 120 | env: |
| 121 | - name: CSI_ENDPOINT |
| 122 | value: unix://C:\\csi\\csi.sock |
| 123 | - name: KUBE_NODE_NAME |
| 124 | valueFrom: |
| 125 | fieldRef: |
| 126 | apiVersion: v1 |
| 127 | fieldPath: spec.nodeName |
| 128 | volumeMounts: |
| 129 | - name: kubelet-dir |
| 130 | mountPath: {{ .Values.windows.kubelet }}\ |
| 131 | - name: plugin-dir |
| 132 | mountPath: C:\csi |
| 133 | - name: csi-proxy-fs-pipe-v1 |
| 134 | mountPath: \\.\pipe\csi-proxy-filesystem-v1 |
| 135 | - name: csi-proxy-smb-pipe-v1 |
| 136 | mountPath: \\.\pipe\csi-proxy-smb-v1 |
| 137 | # these paths are still included for compatibility, they're used |
| 138 | # only if the node has still the beta version of the CSI proxy |
| 139 | - name: csi-proxy-fs-pipe-v1beta1 |
| 140 | mountPath: \\.\pipe\csi-proxy-filesystem-v1beta1 |
| 141 | - name: csi-proxy-smb-pipe-v1beta1 |
| 142 | mountPath: \\.\pipe\csi-proxy-smb-v1beta1 |
| 143 | resources: {{- toYaml .Values.windows.resources.smb | nindent 12 }} |
| 144 | volumes: |
| 145 | - name: csi-proxy-fs-pipe-v1 |
| 146 | hostPath: |
| 147 | path: \\.\pipe\csi-proxy-filesystem-v1 |
| 148 | - name: csi-proxy-smb-pipe-v1 |
| 149 | hostPath: |
| 150 | path: \\.\pipe\csi-proxy-smb-v1 |
| 151 | # these paths are still included for compatibility, they're used |
| 152 | # only if the node has still the beta version of the CSI proxy |
| 153 | - name: csi-proxy-fs-pipe-v1beta1 |
| 154 | hostPath: |
| 155 | path: \\.\pipe\csi-proxy-filesystem-v1beta1 |
| 156 | - name: csi-proxy-smb-pipe-v1beta1 |
| 157 | hostPath: |
| 158 | path: \\.\pipe\csi-proxy-smb-v1beta1 |
| 159 | - name: registration-dir |
| 160 | hostPath: |
| 161 | path: {{ .Values.windows.kubelet }}\plugins_registry\ |
| 162 | type: Directory |
| 163 | - name: kubelet-dir |
| 164 | hostPath: |
| 165 | path: {{ .Values.windows.kubelet }}\ |
| 166 | type: Directory |
| 167 | - name: plugin-dir |
| 168 | hostPath: |
| 169 | path: {{ .Values.windows.kubelet }}\plugins\{{ .Values.driver.name }}\ |
| 170 | type: DirectoryOrCreate |
| 171 | {{- end -}} |