|
| 1 | +apiVersion: apps/v1 |
| 2 | +kind: DaemonSet |
| 3 | +metadata: |
| 4 | + namespace: {{ .Values.namespace }} |
| 5 | + name: {{ include "model-csi-driver.fullname" . }} |
| 6 | + labels: |
| 7 | + {{- include "model-csi-driver.labels" . | nindent 4 }} |
| 8 | +spec: |
| 9 | + selector: |
| 10 | + matchLabels: |
| 11 | + {{- include "model-csi-driver.selectorLabels" . | nindent 6 }} |
| 12 | + {{- with .Values.updateStrategy }} |
| 13 | + updateStrategy: |
| 14 | + {{- toYaml . | nindent 4 }} |
| 15 | + {{- end }} |
| 16 | + template: |
| 17 | + metadata: |
| 18 | + {{- with .Values.podAnnotations }} |
| 19 | + annotations: |
| 20 | + {{- toYaml . | nindent 8 }} |
| 21 | + {{- end }} |
| 22 | + labels: |
| 23 | + {{- include "model-csi-driver.selectorLabels" . | nindent 8 }} |
| 24 | + {{- with .Values.podLabels }} |
| 25 | + {{- toYaml . | nindent 8 }} |
| 26 | + {{- end }} |
| 27 | + spec: |
| 28 | + {{- with .Values.imagePullSecrets }} |
| 29 | + imagePullSecrets: |
| 30 | + {{- toYaml . | nindent 8 }} |
| 31 | + {{- end }} |
| 32 | + {{- if .Values.hostNetwork }} |
| 33 | + hostNetwork: {{ .Values.hostNetwork }} |
| 34 | + {{- end }} |
| 35 | + containers: |
| 36 | + - name: csi-driver-registrar |
| 37 | + image: "{{ .Values.registrar.image.repository }}:{{ .Values.registrar.image.tag }}" |
| 38 | + imagePullPolicy: {{ .Values.registrar.image.pullPolicy | default "IfNotPresent" }} |
| 39 | + args: |
| 40 | + - "--v=5" |
| 41 | + - "--csi-address=/csi/csi.sock" |
| 42 | + - "--kubelet-registration-path=/var/lib/kubelet/plugins/{{ .Values.config.serviceName }}/csi.sock" |
| 43 | + resources: |
| 44 | + limits: |
| 45 | + cpu: "0.5" |
| 46 | + memory: 256Mi |
| 47 | + ephemeral-storage: 1Gi |
| 48 | + requests: |
| 49 | + cpu: 0 |
| 50 | + memory: 0 |
| 51 | + ephemeral-storage: 0 |
| 52 | + livenessProbe: |
| 53 | + exec: |
| 54 | + command: |
| 55 | + - /csi-node-driver-registrar |
| 56 | + - --kubelet-registration-path=/var/lib/kubelet/plugins/{{ .Values.config.serviceName }}/csi.sock |
| 57 | + - --mode=kubelet-registration-probe |
| 58 | + initialDelaySeconds: 30 |
| 59 | + timeoutSeconds: 15 |
| 60 | + valumeMounts: |
| 61 | + - name: plugin-dir |
| 62 | + mountPath: /csi |
| 63 | + - name: {{ .Chart.Name }} |
| 64 | + image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" |
| 65 | + imagePullPolicy: {{ .Values.image.pullPolicy | default "IfNotPresent" }} |
| 66 | + {{- with .Values.command }} |
| 67 | + command: |
| 68 | + {{- toYaml . | nindent 12 }} |
| 69 | + {{- end }} |
| 70 | + livenessProbe: |
| 71 | + exec: |
| 72 | + command: |
| 73 | + - /bin/sh |
| 74 | + - -c |
| 75 | + - | |
| 76 | + stat /csi/csi.sock |
| 77 | + failureThreshold: 2 |
| 78 | + initialDelaySeconds: 5 |
| 79 | + periodSeconds: 10 |
| 80 | + {{- with .Values.args }} |
| 81 | + args: |
| 82 | + {{- toYaml . | nindent 12 }} |
| 83 | + {{- end }} |
| 84 | + env: |
| 85 | + - name: POD_IP |
| 86 | + valueFrom: |
| 87 | + fieldRef: |
| 88 | + apiVersion: v1 |
| 89 | + fieldPath: status.podIP |
| 90 | + - name: X_CSI_MODE |
| 91 | + value: node |
| 92 | + - name: CSI_NODE_ID |
| 93 | + valueFrom: |
| 94 | + fieldRef: |
| 95 | + fieldPath: spec.nodeName |
| 96 | + {{- with .Values.env }} |
| 97 | + {{- toYaml . | nindent 12 }} |
| 98 | + {{- end }} |
| 99 | + securityContext: |
| 100 | + privileged: true |
| 101 | + capabilities: |
| 102 | + add: ["SYS_ADMIN"] |
| 103 | + allowPrivilegeEscalation: true |
| 104 | + resources: |
| 105 | + {{- toYaml .Values.resources | nindent 12 }} |
| 106 | + volumeMounts: |
| 107 | + - name: plugin-dir |
| 108 | + mountPath: /csi |
| 109 | + - mountPath: /etc/model-csi-driver |
| 110 | + name: config-dir |
| 111 | + readOnly: true |
| 112 | + - mountPath: {{ .Values.config.rootDir }} |
| 113 | + name: root-dir |
| 114 | + mountPropagation: "Bidirectional" |
| 115 | + {{- with .Values.volumeMounts }} |
| 116 | + {{- toYaml . | nindent 12 }} |
| 117 | + {{- end }} |
| 118 | + {{- with .Values.livenessProbe }} |
| 119 | + livenessProbe: |
| 120 | + {{- toYaml . | nindent 12 }} |
| 121 | + {{- end }} |
| 122 | + {{- with .Values.readinessProbe }} |
| 123 | + readinessProbe: |
| 124 | + {{- toYaml . | nindent 12 }} |
| 125 | + {{- end }} |
| 126 | + volumes: |
| 127 | + - name: plugin-dir |
| 128 | + hostPath: |
| 129 | + path: /var/lib/kubelet/plugins/{{ .Values.config.serviceName }} |
| 130 | + type: DirectoryOrCreate |
| 131 | + - name: config-dir |
| 132 | + configMap: |
| 133 | + defaultMode: 420 |
| 134 | + name: config |
| 135 | + - name: root-dir |
| 136 | + hostPath: |
| 137 | + path: {{ .Values.config.rootDir }} |
| 138 | + type: DirectoryOrCreate |
| 139 | + {{- toYaml .Values.volumes | nindent 8 }} |
| 140 | + {{- with .Values.priorityClassName }} |
| 141 | + priorityClassName: {{ . }} |
| 142 | + {{- end }} |
| 143 | + tolerations: |
| 144 | + {{- toYaml .Values.tolerations | nindent 8 }} |
| 145 | + nodeSelector: |
| 146 | + {{- toYaml .Values.nodeSelector | nindent 8 }} |
| 147 | + affinity: |
| 148 | + {{- toYaml .Values.affinity | nindent 8 }} |
0 commit comments