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.

200 lines
4.9 KiB

  1. ##### Node Service Account, Roles, RoleBindings
  2. apiVersion: v1
  3. kind: ServiceAccount
  4. metadata:
  5. name: csi-gce-pd-node-sa
  6. namespace: kube-system
  7. ---
  8. ##### Controller Service Account, Roles, Rolebindings
  9. apiVersion: v1
  10. kind: ServiceAccount
  11. metadata:
  12. name: csi-gce-pd-controller-sa
  13. namespace: kube-system
  14. ---
  15. # xref: https://github.com/kubernetes-csi/external-provisioner/blob/master/deploy/kubernetes/rbac.yaml
  16. kind: ClusterRole
  17. apiVersion: rbac.authorization.k8s.io/v1
  18. metadata:
  19. name: csi-gce-pd-provisioner-role
  20. rules:
  21. - apiGroups: [""]
  22. resources: ["persistentvolumes"]
  23. verbs: ["get", "list", "watch", "create", "delete"]
  24. - apiGroups: [""]
  25. resources: ["persistentvolumeclaims"]
  26. verbs: ["get", "list", "watch", "update"]
  27. - apiGroups: ["storage.k8s.io"]
  28. resources: ["storageclasses"]
  29. verbs: ["get", "list", "watch"]
  30. - apiGroups: [""]
  31. resources: ["events"]
  32. verbs: ["list", "watch", "create", "update", "patch"]
  33. - apiGroups: ["storage.k8s.io"]
  34. resources: ["csinodes"]
  35. verbs: ["get", "list", "watch"]
  36. - apiGroups: [""]
  37. resources: ["nodes"]
  38. verbs: ["get", "list", "watch"]
  39. ---
  40. kind: ClusterRoleBinding
  41. apiVersion: rbac.authorization.k8s.io/v1
  42. metadata:
  43. name: csi-gce-pd-controller-provisioner-binding
  44. subjects:
  45. - kind: ServiceAccount
  46. name: csi-gce-pd-controller-sa
  47. namespace: kube-system
  48. roleRef:
  49. kind: ClusterRole
  50. name: csi-gce-pd-provisioner-role
  51. apiGroup: rbac.authorization.k8s.io
  52. ---
  53. # xref: https://github.com/kubernetes-csi/external-attacher/blob/master/deploy/kubernetes/rbac.yaml
  54. kind: ClusterRole
  55. apiVersion: rbac.authorization.k8s.io/v1
  56. metadata:
  57. name: csi-gce-pd-attacher-role
  58. rules:
  59. - apiGroups: [""]
  60. resources: ["persistentvolumes"]
  61. verbs: ["get", "list", "watch", "update", "patch"]
  62. - apiGroups: [""]
  63. resources: ["nodes"]
  64. verbs: ["get", "list", "watch"]
  65. - apiGroups: ["storage.k8s.io"]
  66. resources: ["csinodes"]
  67. verbs: ["get", "list", "watch"]
  68. - apiGroups: ["storage.k8s.io"]
  69. resources: ["volumeattachments"]
  70. verbs: ["get", "list", "watch", "update", "patch"]
  71. - apiGroups: ["storage.k8s.io"]
  72. resources: ["volumeattachments/status"]
  73. verbs: ["patch"]
  74. ---
  75. kind: ClusterRoleBinding
  76. apiVersion: rbac.authorization.k8s.io/v1
  77. metadata:
  78. name: csi-gce-pd-controller-attacher-binding
  79. subjects:
  80. - kind: ServiceAccount
  81. name: csi-gce-pd-controller-sa
  82. namespace: kube-system
  83. roleRef:
  84. kind: ClusterRole
  85. name: csi-gce-pd-attacher-role
  86. apiGroup: rbac.authorization.k8s.io
  87. ---
  88. apiVersion: scheduling.k8s.io/v1
  89. kind: PriorityClass
  90. metadata:
  91. name: csi-gce-pd-controller
  92. value: 900000000
  93. globalDefault: false
  94. description: "This priority class should be used for the GCE PD CSI driver controller deployment only."
  95. ---
  96. apiVersion: scheduling.k8s.io/v1
  97. kind: PriorityClass
  98. metadata:
  99. name: csi-gce-pd-node
  100. value: 900001000
  101. globalDefault: false
  102. description: "This priority class should be used for the GCE PD CSI driver node deployment only."
  103. ---
  104. # Resizer must be able to work with PVCs, PVs, SCs.
  105. kind: ClusterRole
  106. apiVersion: rbac.authorization.k8s.io/v1
  107. metadata:
  108. name: csi-gce-pd-resizer-role
  109. rules:
  110. - apiGroups: [""]
  111. resources: ["persistentvolumes"]
  112. verbs: ["get", "list", "watch", "update", "patch"]
  113. - apiGroups: [""]
  114. resources: ["persistentvolumeclaims"]
  115. verbs: ["get", "list", "watch"]
  116. - apiGroups: [""]
  117. resources: ["persistentvolumeclaims/status"]
  118. verbs: ["update", "patch"]
  119. - apiGroups: [""]
  120. resources: ["events"]
  121. verbs: ["list", "watch", "create", "update", "patch"]
  122. ---
  123. kind: ClusterRoleBinding
  124. apiVersion: rbac.authorization.k8s.io/v1
  125. metadata:
  126. name: csi-gce-pd-resizer-binding
  127. subjects:
  128. - kind: ServiceAccount
  129. name: csi-gce-pd-controller-sa
  130. namespace: kube-system
  131. roleRef:
  132. kind: ClusterRole
  133. name: csi-gce-pd-resizer-role
  134. apiGroup: rbac.authorization.k8s.io
  135. ---
  136. apiVersion: policy/v1beta1
  137. kind: PodSecurityPolicy
  138. metadata:
  139. name: csi-gce-pd-node-psp
  140. spec:
  141. seLinux:
  142. rule: RunAsAny
  143. supplementalGroups:
  144. rule: RunAsAny
  145. runAsUser:
  146. rule: RunAsAny
  147. fsGroup:
  148. rule: RunAsAny
  149. privileged: true
  150. volumes:
  151. - '*'
  152. hostNetwork: true
  153. allowedHostPaths:
  154. - pathPrefix: "/var/lib/kubelet/plugins_registry/"
  155. - pathPrefix: "/var/lib/kubelet"
  156. - pathPrefix: "/var/lib/kubelet/plugins/pd.csi.storage.gke.io/"
  157. - pathPrefix: "/dev"
  158. - pathPrefix: "/etc/udev"
  159. - pathPrefix: "/lib/udev"
  160. - pathPrefix: "/run/udev"
  161. - pathPrefix: "/sys"
  162. ---
  163. kind: ClusterRole
  164. apiVersion: rbac.authorization.k8s.io/v1
  165. metadata:
  166. name: csi-gce-pd-node-deploy
  167. rules:
  168. - apiGroups: ['policy']
  169. resources: ['podsecuritypolicies']
  170. verbs: ['use']
  171. resourceNames:
  172. - csi-gce-pd-node-psp
  173. ---
  174. apiVersion: rbac.authorization.k8s.io/v1
  175. kind: ClusterRoleBinding
  176. metadata:
  177. name: csi-gce-pd-node
  178. roleRef:
  179. apiGroup: rbac.authorization.k8s.io
  180. kind: ClusterRole
  181. name: csi-gce-pd-node-deploy
  182. subjects:
  183. - kind: ServiceAccount
  184. name: csi-gce-pd-node-sa
  185. namespace: kube-system