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.

123 lines
4.1 KiB

  1. # This YAML file contains driver-registrar & csi driver nodeplugin API objects,
  2. # which are necessary to run csi nodeplugin for cinder.
  3. kind: DaemonSet
  4. apiVersion: apps/v1
  5. metadata:
  6. name: csi-cinder-nodeplugin
  7. namespace: kube-system
  8. spec:
  9. selector:
  10. matchLabels:
  11. app: csi-cinder-nodeplugin
  12. template:
  13. metadata:
  14. labels:
  15. app: csi-cinder-nodeplugin
  16. spec:
  17. serviceAccount: csi-cinder-node-sa
  18. hostNetwork: true
  19. containers:
  20. - name: node-driver-registrar
  21. image: {{ csi_node_driver_registrar_image_repo }}:{{ csi_node_driver_registrar_image_tag }}
  22. imagePullPolicy: {{ k8s_image_pull_policy }}
  23. args:
  24. - "--csi-address=$(ADDRESS)"
  25. - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
  26. lifecycle:
  27. preStop:
  28. exec:
  29. command: ["/bin/sh", "-c", "rm -rf /registration/cinder.csi.openstack.org /registration/cinder.csi.openstack.org-reg.sock"]
  30. env:
  31. - name: ADDRESS
  32. value: /csi/csi.sock
  33. - name: DRIVER_REG_SOCK_PATH
  34. value: /var/lib/kubelet/plugins/cinder.csi.openstack.org/csi.sock
  35. - name: KUBE_NODE_NAME
  36. valueFrom:
  37. fieldRef:
  38. fieldPath: spec.nodeName
  39. volumeMounts:
  40. - name: socket-dir
  41. mountPath: /csi
  42. - name: registration-dir
  43. mountPath: /registration
  44. - name: cinder-csi-plugin
  45. securityContext:
  46. privileged: true
  47. capabilities:
  48. add: ["SYS_ADMIN"]
  49. allowPrivilegeEscalation: true
  50. image: {{ cinder_csi_plugin_image_repo }}:{{ cinder_csi_plugin_image_tag }}
  51. imagePullPolicy: {{ k8s_image_pull_policy }}
  52. args:
  53. - /bin/cinder-csi-plugin
  54. - "--nodeid=$(NODE_ID)"
  55. - "--endpoint=$(CSI_ENDPOINT)"
  56. - "--cloud-config=$(CLOUD_CONFIG)"
  57. env:
  58. - name: NODE_ID
  59. valueFrom:
  60. fieldRef:
  61. fieldPath: spec.nodeName
  62. - name: CSI_ENDPOINT
  63. value: unix://csi/csi.sock
  64. - name: CLOUD_CONFIG
  65. value: /etc/config/cloud.conf
  66. volumeMounts:
  67. - name: socket-dir
  68. mountPath: /csi
  69. - name: kubelet-dir
  70. mountPath: /var/lib/kubelet
  71. mountPropagation: "Bidirectional"
  72. - name: pods-cloud-data
  73. mountPath: /var/lib/cloud/data
  74. readOnly: true
  75. - name: pods-probe-dir
  76. mountPath: /dev
  77. mountPropagation: "HostToContainer"
  78. - name: secret-cinderplugin
  79. mountPath: /etc/config
  80. readOnly: true
  81. - name: ca-certs
  82. mountPath: /etc/ssl/certs
  83. readOnly: true
  84. {% if cinder_cacert is defined and cinder_cacert != "" %}
  85. - name: cinder-cacert
  86. mountPath: {{ kube_config_dir }}/cinder-cacert.pem
  87. readOnly: true
  88. {% endif %}
  89. volumes:
  90. - name: socket-dir
  91. hostPath:
  92. path: /var/lib/kubelet/plugins/cinder.csi.openstack.org
  93. type: DirectoryOrCreate
  94. - name: registration-dir
  95. hostPath:
  96. path: /var/lib/kubelet/plugins_registry/
  97. type: Directory
  98. - name: kubelet-dir
  99. hostPath:
  100. path: /var/lib/kubelet
  101. type: Directory
  102. - name: pods-cloud-data
  103. hostPath:
  104. path: /var/lib/cloud/data
  105. type: Directory
  106. - name: pods-probe-dir
  107. hostPath:
  108. path: /dev
  109. type: Directory
  110. - name: secret-cinderplugin
  111. secret:
  112. secretName: cloud-config
  113. - name: ca-certs
  114. hostPath:
  115. path: /etc/ssl/certs
  116. type: DirectoryOrCreate
  117. {% if cinder_cacert is defined and cinder_cacert != "" %}
  118. - name: cinder-cacert
  119. hostPath:
  120. path: {{ kube_config_dir }}/cinder-cacert.pem
  121. type: FileOrCreate
  122. {% endif %}