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.

100 lines
3.1 KiB

  1. kind: DaemonSet
  2. apiVersion: apps/v1
  3. metadata:
  4. name: csi-upcloud-node
  5. namespace: kube-system
  6. spec:
  7. selector:
  8. matchLabels:
  9. app: csi-upcloud-node
  10. template:
  11. metadata:
  12. labels:
  13. app: csi-upcloud-node
  14. role: csi-upcloud
  15. spec:
  16. priorityClassName: system-node-critical
  17. serviceAccount: csi-upcloud-node-sa
  18. hostNetwork: true
  19. containers:
  20. - name: csi-node-driver-registrar
  21. image: registry.k8s.io/sig-storage/csi-node-driver-registrar:{{ upcloud_csi_node_image_tag }}
  22. args:
  23. - "--v=5"
  24. - "--csi-address=$(ADDRESS)"
  25. - "--kubelet-registration-path=$(DRIVER_REG_SOCK_PATH)"
  26. env:
  27. - name: ADDRESS
  28. value: /csi/csi.sock
  29. - name: DRIVER_REG_SOCK_PATH
  30. value: /var/lib/kubelet/plugins/storage.csi.upcloud.com/csi.sock
  31. - name: KUBE_NODE_NAME
  32. valueFrom:
  33. fieldRef:
  34. fieldPath: spec.nodeName
  35. volumeMounts:
  36. - name: plugin-dir
  37. mountPath: /csi/
  38. - name: registration-dir
  39. mountPath: /registration/
  40. - name: csi-upcloud-plugin
  41. image: ghcr.io/upcloudltd/upcloud-csi:{{ upcloud_csi_plugin_image_tag }}
  42. args:
  43. - "--endpoint=$(CSI_ENDPOINT)"
  44. - "--nodehost=$(NODE_ID)"
  45. - "--mode=monolith"
  46. env:
  47. - name: CSI_ENDPOINT
  48. value: unix:///csi/csi.sock
  49. - name: UPCLOUD_USERNAME
  50. valueFrom:
  51. secretKeyRef:
  52. name: upcloud
  53. key: username
  54. - name: UPCLOUD_PASSWORD
  55. valueFrom:
  56. secretKeyRef:
  57. name: upcloud
  58. key: password
  59. - name: NODE_ID
  60. valueFrom:
  61. fieldRef:
  62. fieldPath: spec.nodeName
  63. imagePullPolicy: "Always"
  64. securityContext:
  65. privileged: true
  66. capabilities:
  67. add: ["SYS_ADMIN"]
  68. allowPrivilegeEscalation: true
  69. volumeMounts:
  70. - name: plugin-dir
  71. mountPath: /csi
  72. - name: pods-mount-dir
  73. mountPath: /var/lib/kubelet
  74. # needed so that any mounts setup inside this container are
  75. # propagated back to the host machine.
  76. mountPropagation: "Bidirectional"
  77. - name: device-dir
  78. mountPath: /dev
  79. imagePullSecrets:
  80. - name: regcred
  81. volumes:
  82. - name: registration-dir
  83. hostPath:
  84. path: /var/lib/kubelet/plugins_registry/
  85. type: DirectoryOrCreate
  86. - name: plugin-dir
  87. hostPath:
  88. path: /var/lib/kubelet/plugins/storage.csi.upcloud.com
  89. type: DirectoryOrCreate
  90. - name: pods-mount-dir
  91. hostPath:
  92. path: /var/lib/kubelet
  93. type: Directory
  94. - name: device-dir
  95. hostPath:
  96. path: /dev
  97. {% if upcloud_tolerations %}
  98. tolerations:
  99. {{ upcloud_tolerations | to_nice_yaml(indent=2) | indent(width=8) }}
  100. {% endif %}