You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

170 lines
5.6 KiB

  1. kind: DaemonSet
  2. apiVersion: apps/v1
  3. metadata:
  4. name: vsphere-csi-node
  5. namespace: "{{ vsphere_csi_namespace }}"
  6. spec:
  7. selector:
  8. matchLabels:
  9. app: vsphere-csi-node
  10. updateStrategy:
  11. type: "RollingUpdate"
  12. rollingUpdate:
  13. maxUnavailable: 1
  14. template:
  15. metadata:
  16. labels:
  17. app: vsphere-csi-node
  18. role: vsphere-csi
  19. spec:
  20. priorityClassName: system-node-critical
  21. nodeSelector:
  22. kubernetes.io/os: linux
  23. {% if vsphere_csi_node_affinity %}
  24. affinity:
  25. {{ vsphere_csi_node_affinity | to_nice_yaml | indent(width=8) }}
  26. {% endif %}
  27. serviceAccountName: vsphere-csi-node
  28. hostNetwork: true
  29. dnsPolicy: "ClusterFirstWithHostNet"
  30. containers:
  31. - name: node-driver-registrar
  32. image: {{ kube_image_repo }}/sig-storage/csi-node-driver-registrar:{{ vsphere_csi_node_driver_registrar_image_tag }}
  33. {% if external_vsphere_version < "7.0u1" %}
  34. lifecycle:
  35. preStop:
  36. exec:
  37. command: ["/bin/sh", "-c", "rm -rf /registration/csi.vsphere.vmware.com-reg.sock /csi/csi.sock"]
  38. {% endif %}
  39. args:
  40. - "--v=5"
  41. - "--csi-address=$(ADDRESS)"
  42. - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
  43. {% if vsphere_csi_node_driver_registrar_resources | length > 0 %}
  44. resources:
  45. {{ vsphere_csi_node_driver_registrar_resources | default({}) | to_nice_yaml | trim | indent(width=10) }}
  46. {% endif %}
  47. env:
  48. - name: ADDRESS
  49. value: /csi/csi.sock
  50. - name: DRIVER_REG_SOCK_PATH
  51. value: /var/lib/kubelet/plugins/csi.vsphere.vmware.com/csi.sock
  52. volumeMounts:
  53. - name: plugin-dir
  54. mountPath: /csi
  55. - name: registration-dir
  56. mountPath: /registration
  57. livenessProbe:
  58. exec:
  59. command:
  60. - /csi-node-driver-registrar
  61. - --kubelet-registration-path=/var/lib/kubelet/plugins/csi.vsphere.vmware.com/csi.sock
  62. - --mode=kubelet-registration-probe
  63. initialDelaySeconds: 3
  64. - name: vsphere-csi-node
  65. image: {{ gcr_image_repo }}/cloud-provider-vsphere/csi/release/driver:{{ vsphere_csi_driver_image_tag }}
  66. imagePullPolicy: {{ k8s_image_pull_policy }}
  67. args:
  68. - "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
  69. - "--fss-namespace={{ vsphere_csi_namespace }}"
  70. imagePullPolicy: "Always"
  71. {% if vsphere_csi_driver_resources | length > 0 %}
  72. resources:
  73. {{ vsphere_csi_driver_resources | default({}) | to_nice_yaml | trim | indent(width=10) }}
  74. {% endif %}
  75. env:
  76. - name: NODE_NAME
  77. valueFrom:
  78. fieldRef:
  79. fieldPath: spec.nodeName
  80. - name: CSI_ENDPOINT
  81. value: unix:///csi/csi.sock
  82. - name: MAX_VOLUMES_PER_NODE
  83. value: "59" # Maximum number of volumes that controller can publish to the node. If value is not set or zero Kubernetes decide how many volumes can be published by the controller to the node.
  84. - name: X_CSI_MODE
  85. value: "node"
  86. - name: X_CSI_SPEC_REQ_VALIDATION
  87. value: "false"
  88. - name: X_CSI_DEBUG
  89. value: "true"
  90. - name: X_CSI_SPEC_DISABLE_LEN_CHECK
  91. value: "true"
  92. - name: LOGGER_LEVEL
  93. value: "PRODUCTION" # Options: DEVELOPMENT, PRODUCTION
  94. - name: GODEBUG
  95. value: x509sha1=1
  96. - name: NODEGETINFO_WATCH_TIMEOUT_MINUTES
  97. value: "1"
  98. securityContext:
  99. privileged: true
  100. capabilities:
  101. add: ["SYS_ADMIN"]
  102. allowPrivilegeEscalation: true
  103. volumeMounts:
  104. - name: plugin-dir
  105. mountPath: /csi
  106. - name: pods-mount-dir
  107. mountPath: /var/lib/kubelet
  108. # needed so that any mounts setup inside this container are
  109. # propagated back to the host machine.
  110. mountPropagation: "Bidirectional"
  111. - name: device-dir
  112. mountPath: /dev
  113. - name: blocks-dir
  114. mountPath: /sys/block
  115. - name: sys-devices-dir
  116. mountPath: /sys/devices
  117. ports:
  118. - containerPort: 9808
  119. name: healthz
  120. livenessProbe:
  121. httpGet:
  122. path: /healthz
  123. port: healthz
  124. initialDelaySeconds: 10
  125. timeoutSeconds: 5
  126. periodSeconds: 5
  127. failureThreshold: 3
  128. - name: liveness-probe
  129. image: {{ kube_image_repo }}/sig-storage/livenessprobe:{{ vsphere_csi_liveness_probe_image_tag }}
  130. args:
  131. {% if external_vsphere_version >= "7.0u1" %}
  132. - "--v=4"
  133. {% endif %}
  134. - "--csi-address=/csi/csi.sock"
  135. {% if vsphere_csi_liveness_probe_ds_resources | length > 0 %}
  136. resources:
  137. {{ vsphere_csi_liveness_probe_ds_resources | default({}) | to_nice_yaml | trim | indent(width=10) }}
  138. {% endif %}
  139. volumeMounts:
  140. - name: plugin-dir
  141. mountPath: /csi
  142. volumes:
  143. - name: registration-dir
  144. hostPath:
  145. path: /var/lib/kubelet/plugins_registry
  146. type: Directory
  147. - name: plugin-dir
  148. hostPath:
  149. path: /var/lib/kubelet/plugins/csi.vsphere.vmware.com
  150. type: DirectoryOrCreate
  151. - name: pods-mount-dir
  152. hostPath:
  153. path: /var/lib/kubelet
  154. type: Directory
  155. - name: device-dir
  156. hostPath:
  157. path: /dev
  158. - name: blocks-dir
  159. hostPath:
  160. path: /sys/block
  161. type: Directory
  162. - name: sys-devices-dir
  163. hostPath:
  164. path: /sys/devices
  165. type: Directory
  166. tolerations:
  167. - effect: NoExecute
  168. operator: Exists
  169. - effect: NoSchedule
  170. operator: Exists