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.

111 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: {{ gcp_pd_csi_image_repo }}/csi-node-driver-registrar:{{ gcp_pd_csi_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_image_repo }}/gcp-compute-persistent-disk-csi-driver:{{ gcp_pd_csi_driver_image_tag }}
  49. args:
  50. - "--v=5"
  51. - "--endpoint=unix:/csi/csi.sock"
  52. volumeMounts:
  53. - name: kubelet-dir
  54. mountPath: /var/lib/kubelet
  55. mountPropagation: "Bidirectional"
  56. - name: plugin-dir
  57. mountPath: /csi
  58. - name: device-dir
  59. mountPath: /dev
  60. # The following mounts are required to trigger host udevadm from
  61. # container
  62. - name: udev-rules-etc
  63. mountPath: /etc/udev
  64. - name: udev-rules-lib
  65. mountPath: /lib/udev
  66. - name: udev-socket
  67. mountPath: /run/udev
  68. - name: sys
  69. mountPath: /sys
  70. nodeSelector:
  71. kubernetes.io/os: linux
  72. volumes:
  73. - name: registration-dir
  74. hostPath:
  75. path: /var/lib/kubelet/plugins_registry/
  76. type: Directory
  77. - name: kubelet-dir
  78. hostPath:
  79. path: /var/lib/kubelet
  80. type: Directory
  81. - name: plugin-dir
  82. hostPath:
  83. path: /var/lib/kubelet/plugins/pd.csi.storage.gke.io/
  84. type: DirectoryOrCreate
  85. - name: device-dir
  86. hostPath:
  87. path: /dev
  88. type: Directory
  89. # The following mounts are required to trigger host udevadm from
  90. # container
  91. - name: udev-rules-etc
  92. hostPath:
  93. path: /etc/udev
  94. type: Directory
  95. - name: udev-rules-lib
  96. hostPath:
  97. path: /lib/udev
  98. type: Directory
  99. - name: udev-socket
  100. hostPath:
  101. path: /run/udev
  102. type: Directory
  103. - name: sys
  104. hostPath:
  105. path: /sys
  106. type: Directory
  107. # https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
  108. # See "special case". This will tolerate everything. Node component should
  109. # be scheduled on all nodes.
  110. tolerations:
  111. - operator: Exists