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.

175 lines
5.3 KiB

  1. kind: DaemonSet
  2. apiVersion: apps/v1
  3. metadata:
  4. name: vsphere-csi-node
  5. namespace: kube-system
  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. dnsPolicy: "Default"
  21. containers:
  22. - name: node-driver-registrar
  23. image: {{ quay_image_repo }}/k8scsi/csi-node-driver-registrar:{{ vsphere_csi_node_driver_registrar_image_tag }}
  24. {% if external_vsphere_version < "7.0u1" %}
  25. lifecycle:
  26. preStop:
  27. exec:
  28. command: ["/bin/sh", "-c", "rm -rf /registration/csi.vsphere.vmware.com-reg.sock /csi/csi.sock"]
  29. {% endif %}
  30. args:
  31. - "--v=5"
  32. - "--csi-address=$(ADDRESS)"
  33. - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
  34. {% if external_vsphere_version >= "7.0u1" %}
  35. - "--health-port=9809"
  36. {% endif %}
  37. env:
  38. - name: ADDRESS
  39. value: /csi/csi.sock
  40. - name: DRIVER_REG_SOCK_PATH
  41. value: /var/lib/kubelet/plugins/csi.vsphere.vmware.com/csi.sock
  42. {% if vsphere_csi_controller is version('v2.2.0', '<') %}
  43. securityContext:
  44. privileged: true
  45. {% endif %}
  46. volumeMounts:
  47. - name: plugin-dir
  48. mountPath: /csi
  49. - name: registration-dir
  50. mountPath: /registration
  51. {% if external_vsphere_version >= "7.0u1" %}
  52. ports:
  53. - containerPort: 9809
  54. name: healthz
  55. livenessProbe:
  56. httpGet:
  57. path: /healthz
  58. port: healthz
  59. initialDelaySeconds: 5
  60. timeoutSeconds: 5
  61. {% endif %}
  62. - name: vsphere-csi-node
  63. image: {{ gcr_image_repo }}/cloud-provider-vsphere/csi/release/driver:{{ vsphere_csi_driver_image_tag }}
  64. imagePullPolicy: {{ k8s_image_pull_policy }}
  65. {% if external_vsphere_version >= "7.0u1" %}
  66. args:
  67. - "--fss-name=internal-feature-states.csi.vsphere.vmware.com"
  68. - "--fss-namespace=$(CSI_NAMESPACE)"
  69. {% endif %}
  70. imagePullPolicy: "Always"
  71. env:
  72. - name: NODE_NAME
  73. valueFrom:
  74. fieldRef:
  75. fieldPath: spec.nodeName
  76. - name: CSI_ENDPOINT
  77. value: unix:///csi/csi.sock
  78. - name: X_CSI_MODE
  79. value: "node"
  80. - name: X_CSI_SPEC_REQ_VALIDATION
  81. value: "false"
  82. # needed only for topology aware setups
  83. #- name: VSPHERE_CSI_CONFIG
  84. # value: "/etc/cloud/csi-vsphere.conf" # here csi-vsphere.conf is the name of the file used for creating secret using "--from-file" flag
  85. - name: X_CSI_DEBUG
  86. value: "true"
  87. - name: LOGGER_LEVEL
  88. value: "PRODUCTION" # Options: DEVELOPMENT, PRODUCTION
  89. {% if external_vsphere_version >= "7.0u1" %}
  90. - name: CSI_NAMESPACE
  91. valueFrom:
  92. fieldRef:
  93. fieldPath: metadata.namespace
  94. {% endif %}
  95. securityContext:
  96. privileged: true
  97. capabilities:
  98. add: ["SYS_ADMIN"]
  99. allowPrivilegeEscalation: true
  100. volumeMounts:
  101. # needed only for topology aware setups
  102. #- name: vsphere-config-volume
  103. # mountPath: /etc/cloud
  104. # readOnly: true
  105. - name: plugin-dir
  106. mountPath: /csi
  107. - name: pods-mount-dir
  108. mountPath: /var/lib/kubelet
  109. # needed so that any mounts setup inside this container are
  110. # propagated back to the host machine.
  111. mountPropagation: "Bidirectional"
  112. - name: device-dir
  113. mountPath: /dev
  114. {% if vsphere_csi_controller is version('v2.2.0', '>=') %}
  115. - name: blocks-dir
  116. mountPath: /sys/block
  117. - name: sys-devices-dir
  118. mountPath: /sys/devices
  119. {% endif %}
  120. ports:
  121. - containerPort: 9808
  122. name: healthz
  123. livenessProbe:
  124. httpGet:
  125. path: /healthz
  126. port: healthz
  127. initialDelaySeconds: 10
  128. timeoutSeconds: 5
  129. periodSeconds: 5
  130. failureThreshold: 3
  131. - name: liveness-probe
  132. image: {{ quay_image_repo }}/k8scsi/livenessprobe:{{ vsphere_csi_liveness_probe_image_tag }}
  133. args:
  134. {% if external_vsphere_version >= "7.0u1" %}
  135. - "--v=4"
  136. {% endif %}
  137. - "--csi-address=/csi/csi.sock"
  138. volumeMounts:
  139. - name: plugin-dir
  140. mountPath: /csi
  141. volumes:
  142. # needed only for topology aware setups
  143. #- name: vsphere-config-volume
  144. # secret:
  145. # secretName: vsphere-config-secret
  146. - name: registration-dir
  147. hostPath:
  148. path: /var/lib/kubelet/plugins_registry
  149. type: Directory
  150. - name: plugin-dir
  151. hostPath:
  152. path: /var/lib/kubelet/plugins/csi.vsphere.vmware.com
  153. type: DirectoryOrCreate
  154. - name: pods-mount-dir
  155. hostPath:
  156. path: /var/lib/kubelet
  157. type: Directory
  158. - name: device-dir
  159. hostPath:
  160. path: /dev
  161. {% if vsphere_csi_controller is version('v2.2.0', '>=') %}
  162. - name: blocks-dir
  163. hostPath:
  164. path: /sys/block
  165. type: Directory
  166. - name: sys-devices-dir
  167. hostPath:
  168. path: /sys/devices
  169. type: Directory
  170. {% endif %}
  171. tolerations:
  172. - effect: NoExecute
  173. operator: Exists
  174. - effect: NoSchedule
  175. operator: Exists