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.

112 lines
3.7 KiB

  1. kind: DaemonSet
  2. apiVersion: apps/v1
  3. metadata:
  4. name: csi-gce-pd-node
  5. namespace: kube-system
  6. spec:
  7. selector:
  8. matchLabels:
  9. app: gcp-compute-persistent-disk-csi-driver
  10. template:
  11. metadata:
  12. labels:
  13. app: gcp-compute-persistent-disk-csi-driver
  14. spec:
  15. # Host network must be used for interaction with Workload Identity in GKE
  16. # since it replaces GCE Metadata Server with GKE Metadata Server. Remove
  17. # this requirement when issue is resolved and before any exposure of
  18. # metrics ports.
  19. hostNetwork: true
  20. priorityClassName: csi-gce-pd-node
  21. serviceAccountName: csi-gce-pd-node-sa
  22. containers:
  23. - name: csi-driver-registrar
  24. image: {{ csi_node_driver_registrar_image_repo }}:{{ csi_node_driver_registrar_image_tag }}
  25. args:
  26. - "--v=5"
  27. - "--csi-address=/csi/csi.sock"
  28. - "--kubelet-registration-path=/var/lib/kubelet/plugins/pd.csi.storage.gke.io/csi.sock"
  29. lifecycle:
  30. preStop:
  31. exec:
  32. command: ["/bin/sh", "-c", "rm -rf /registration/pd.csi.storage.gke.io /registration/pd.csi.storage.gke.io-reg.sock"]
  33. env:
  34. - name: KUBE_NODE_NAME
  35. valueFrom:
  36. fieldRef:
  37. fieldPath: spec.nodeName
  38. volumeMounts:
  39. - name: plugin-dir
  40. mountPath: /csi
  41. - name: registration-dir
  42. mountPath: /registration
  43. - name: gce-pd-driver
  44. securityContext:
  45. privileged: true
  46. # Don't change base image without changing pdImagePlaceholder in
  47. # test/k8s-integration/main.go
  48. image: {{ gcp_pd_csi_plugin_image_repo }}:{{ gcp_pd_csi_plugin_image_tag }}
  49. args:
  50. - "--v=5"
  51. - "--endpoint=unix:/csi/csi.sock"
  52. - "--run-controller-service=false"
  53. volumeMounts:
  54. - name: kubelet-dir
  55. mountPath: /var/lib/kubelet
  56. mountPropagation: "Bidirectional"
  57. - name: plugin-dir
  58. mountPath: /csi
  59. - name: device-dir
  60. mountPath: /dev
  61. # The following mounts are required to trigger host udevadm from
  62. # container
  63. - name: udev-rules-etc
  64. mountPath: /etc/udev
  65. - name: udev-rules-lib
  66. mountPath: /lib/udev
  67. - name: udev-socket
  68. mountPath: /run/udev
  69. - name: sys
  70. mountPath: /sys
  71. nodeSelector:
  72. kubernetes.io/os: linux
  73. volumes:
  74. - name: registration-dir
  75. hostPath:
  76. path: /var/lib/kubelet/plugins_registry/
  77. type: Directory
  78. - name: kubelet-dir
  79. hostPath:
  80. path: /var/lib/kubelet
  81. type: Directory
  82. - name: plugin-dir
  83. hostPath:
  84. path: /var/lib/kubelet/plugins/pd.csi.storage.gke.io/
  85. type: DirectoryOrCreate
  86. - name: device-dir
  87. hostPath:
  88. path: /dev
  89. type: Directory
  90. # The following mounts are required to trigger host udevadm from
  91. # container
  92. - name: udev-rules-etc
  93. hostPath:
  94. path: /etc/udev
  95. type: Directory
  96. - name: udev-rules-lib
  97. hostPath:
  98. path: /lib/udev
  99. type: Directory
  100. - name: udev-socket
  101. hostPath:
  102. path: /run/udev
  103. type: Directory
  104. - name: sys
  105. hostPath:
  106. path: /sys
  107. type: Directory
  108. # https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
  109. # See "special case". This will tolerate everything. Node component should
  110. # be scheduled on all nodes.
  111. tolerations:
  112. - operator: Exists