|
| 1 | +{{- if and .Values.windows.enabled .Values.windows.useHostProcessContainers }} |
| 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 | + securityContext: |
| 41 | + seccompProfile: |
| 42 | + type: RuntimeDefault |
| 43 | + windowsOptions: |
| 44 | + hostProcess: true |
| 45 | + runAsUserName: "NT AUTHORITY\\SYSTEM" |
| 46 | + hostNetwork: true |
| 47 | + initContainers: |
| 48 | + - name: init |
| 49 | +{{- if hasPrefix "/" .Values.image.smb.repository }} |
| 50 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}-windows-hp" |
| 51 | +{{- else }} |
| 52 | + image: "{{ .Values.image.smb.repository }}:{{ .Values.image.smb.tag }}-windows-hp" |
| 53 | +{{- end }} |
| 54 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 55 | + command: |
| 56 | + - "powershell.exe" |
| 57 | + - "-c" |
| 58 | + - "New-Item -ItemType Directory -Path C:\\var\\lib\\kubelet\\plugins\\{{ .Values.driver.name }}\\ -Force" |
| 59 | + securityContext: |
| 60 | + capabilities: |
| 61 | + drop: |
| 62 | + - ALL |
| 63 | + containers: |
| 64 | + - name: node-driver-registrar |
| 65 | +{{- if hasPrefix "/" .Values.image.nodeDriverRegistrar.repository }} |
| 66 | + image: "{{ .Values.image.baseRepo }}{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}" |
| 67 | +{{- else }} |
| 68 | + image: "{{ .Values.image.nodeDriverRegistrar.repository }}:{{ .Values.image.nodeDriverRegistrar.tag }}" |
| 69 | +{{- end }} |
| 70 | + command: |
| 71 | + - "csi-node-driver-registrar.exe" |
| 72 | + args: |
| 73 | + - "--csi-address=$(CSI_ENDPOINT)" |
| 74 | + - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)" |
| 75 | + - "--plugin-registration-path=$(PLUGIN_REG_DIR)" |
| 76 | + - "--v=2" |
| 77 | + env: |
| 78 | + - name: CSI_ENDPOINT |
| 79 | + value: unix://{{ .Values.windows.kubelet }}\plugins\{{ .Values.driver.name }}\csi.sock |
| 80 | + - name: DRIVER_REG_SOCK_PATH |
| 81 | + value: C:\\var\\lib\\kubelet\\plugins\\{{ .Values.driver.name }}\\csi.sock |
| 82 | + - name: PLUGIN_REG_DIR |
| 83 | + value: C:\\var\\lib\\kubelet\\plugins_registry\\ |
| 84 | + - name: KUBE_NODE_NAME |
| 85 | + valueFrom: |
| 86 | + fieldRef: |
| 87 | + fieldPath: spec.nodeName |
| 88 | + imagePullPolicy: {{ .Values.image.nodeDriverRegistrar.pullPolicy }} |
| 89 | + resources: {{- toYaml .Values.windows.resources.nodeDriverRegistrar | nindent 12 }} |
| 90 | + securityContext: |
| 91 | + capabilities: |
| 92 | + drop: |
| 93 | + - ALL |
| 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 | + command: |
| 102 | + - "smbplugin.exe" |
| 103 | + args: |
| 104 | + - "--v={{ .Values.node.logLevel }}" |
| 105 | + - "--drivername={{ .Values.driver.name }}" |
| 106 | + - --endpoint=$(CSI_ENDPOINT) |
| 107 | + - --nodeid=$(KUBE_NODE_NAME) |
| 108 | + - "--enable-get-volume-stats={{ .Values.feature.enableGetVolumeStats }}" |
| 109 | + - "--remove-smb-mapping-during-unmount={{ .Values.windows.removeSMBMappingDuringUnmount }}" |
| 110 | + - "--enable-windows-host-process=true" |
| 111 | + env: |
| 112 | + - name: CSI_ENDPOINT |
| 113 | + value: unix://{{ .Values.windows.kubelet }}\plugins\{{ .Values.driver.name }}\csi.sock |
| 114 | + - name: KUBE_NODE_NAME |
| 115 | + valueFrom: |
| 116 | + fieldRef: |
| 117 | + apiVersion: v1 |
| 118 | + fieldPath: spec.nodeName |
| 119 | + imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 120 | + resources: {{- toYaml .Values.windows.resources.smb | nindent 12 }} |
| 121 | + securityContext: |
| 122 | + capabilities: |
| 123 | + drop: |
| 124 | + - ALL |
| 125 | +{{- end -}} |
0 commit comments