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.

137 lines
4.8 KiB

  1. # This YAML file contains CSI Controller Plugin Sidecars
  2. # external-attacher, external-provisioner, external-snapshotter
  3. ---
  4. kind: Deployment
  5. apiVersion: apps/v1
  6. metadata:
  7. name: csi-cinder-controllerplugin
  8. namespace: kube-system
  9. spec:
  10. replicas: {{ cinder_csi_controller_replicas }}
  11. selector:
  12. matchLabels:
  13. app: csi-cinder-controllerplugin
  14. template:
  15. metadata:
  16. labels:
  17. app: csi-cinder-controllerplugin
  18. spec:
  19. serviceAccount: csi-cinder-controller-sa
  20. containers:
  21. - name: csi-attacher
  22. image: {{ csi_attacher_image_repo }}:{{ csi_attacher_image_tag }}
  23. imagePullPolicy: {{ k8s_image_pull_policy }}
  24. args:
  25. - "--csi-address=$(ADDRESS)"
  26. - "--timeout=3m"
  27. {% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
  28. - --leader-election
  29. - --leader-election-namespace=kube-system
  30. {% endif %}
  31. env:
  32. - name: ADDRESS
  33. value: /var/lib/csi/sockets/pluginproxy/csi.sock
  34. volumeMounts:
  35. - name: socket-dir
  36. mountPath: /var/lib/csi/sockets/pluginproxy/
  37. - name: csi-provisioner
  38. image: {{ csi_provisioner_image_repo }}:{{ csi_provisioner_image_tag }}
  39. imagePullPolicy: {{ k8s_image_pull_policy }}
  40. args:
  41. - "--csi-address=$(ADDRESS)"
  42. - "--timeout=3m"
  43. {% if cinder_topology is defined and cinder_topology %}
  44. - --feature-gates=Topology=true
  45. {% endif %}
  46. {% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
  47. - --enable-leader-election
  48. - --leader-election-type=leases
  49. - --leader-election-namespace=kube-system
  50. {% endif %}
  51. env:
  52. - name: ADDRESS
  53. value: /var/lib/csi/sockets/pluginproxy/csi.sock
  54. volumeMounts:
  55. - name: socket-dir
  56. mountPath: /var/lib/csi/sockets/pluginproxy/
  57. - name: csi-snapshotter
  58. image: {{ csi_snapshotter_image_repo }}:{{ csi_snapshotter_image_tag }}
  59. imagePullPolicy: {{ k8s_image_pull_policy }}
  60. args:
  61. - "--csi-address=$(ADDRESS)"
  62. {% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
  63. - --leader-election
  64. - --leader-election-namespace=kube-system
  65. {% endif %}
  66. env:
  67. - name: ADDRESS
  68. value: /var/lib/csi/sockets/pluginproxy/csi.sock
  69. volumeMounts:
  70. - mountPath: /var/lib/csi/sockets/pluginproxy/
  71. name: socket-dir
  72. - name: csi-resizer
  73. image: {{ csi_resizer_image_repo }}:{{ csi_resizer_image_tag }}
  74. imagePullPolicy: {{ k8s_image_pull_policy }}
  75. args:
  76. - "--csi-address=$(ADDRESS)"
  77. {% if cinder_csi_controller_replicas is defined and cinder_csi_controller_replicas > 1 %}
  78. - --leader-election
  79. - --leader-election-namespace=kube-system
  80. {% endif %}
  81. env:
  82. - name: ADDRESS
  83. value: /var/lib/csi/sockets/pluginproxy/csi.sock
  84. volumeMounts:
  85. - name: socket-dir
  86. mountPath: /var/lib/csi/sockets/pluginproxy/
  87. - name: cinder-csi-plugin
  88. image: {{ cinder_csi_plugin_image_repo }}:{{ cinder_csi_plugin_image_tag }}
  89. imagePullPolicy: {{ k8s_image_pull_policy }}
  90. args:
  91. - /bin/cinder-csi-plugin
  92. - "--nodeid=$(NODE_ID)"
  93. - "--endpoint=$(CSI_ENDPOINT)"
  94. - "--cloud-config=$(CLOUD_CONFIG)"
  95. - "--cluster=$(CLUSTER_NAME)"
  96. env:
  97. - name: NODE_ID
  98. valueFrom:
  99. fieldRef:
  100. fieldPath: spec.nodeName
  101. - name: CSI_ENDPOINT
  102. value: unix://csi/csi.sock
  103. - name: CLOUD_CONFIG
  104. value: /etc/config/cloud.conf
  105. - name: CLUSTER_NAME
  106. value: kubernetes
  107. volumeMounts:
  108. - name: socket-dir
  109. mountPath: /csi
  110. - name: secret-cinderplugin
  111. mountPath: /etc/config
  112. readOnly: true
  113. - name: ca-certs
  114. mountPath: /etc/ssl/certs
  115. readOnly: true
  116. {% if cinder_cacert is defined and cinder_cacert != "" %}
  117. - name: cinder-cacert
  118. mountPath: {{ kube_config_dir }}/cinder-cacert.pem
  119. readOnly: true
  120. {% endif %}
  121. volumes:
  122. - name: socket-dir
  123. emptyDir:
  124. - name: secret-cinderplugin
  125. secret:
  126. secretName: cloud-config
  127. - name: ca-certs
  128. hostPath:
  129. path: /etc/ssl/certs
  130. type: DirectoryOrCreate
  131. {% if cinder_cacert is defined and cinder_cacert != "" %}
  132. - name: cinder-cacert
  133. hostPath:
  134. path: {{ kube_config_dir }}/cinder-cacert.pem
  135. type: FileOrCreate
  136. {% endif %}