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.

241 lines
6.5 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. - apiGroups: ["snapshot.storage.k8s.io"]
  40. resources: ["volumesnapshots"]
  41. verbs: ["get", "list"]
  42. - apiGroups: ["snapshot.storage.k8s.io"]
  43. resources: ["volumesnapshotcontents"]
  44. verbs: ["get", "list"]
  45. # Access to volumeattachments is only needed when the CSI driver
  46. # has the PUBLISH_UNPUBLISH_VOLUME controller capability.
  47. # In that case, external-provisioner will watch volumeattachments
  48. # to determine when it is safe to delete a volume.
  49. - apiGroups: ["storage.k8s.io"]
  50. resources: ["volumeattachments"]
  51. verbs: ["get", "list", "watch"]
  52. ---
  53. kind: ClusterRoleBinding
  54. apiVersion: rbac.authorization.k8s.io/v1
  55. metadata:
  56. name: csi-gce-pd-controller-provisioner-binding
  57. subjects:
  58. - kind: ServiceAccount
  59. name: csi-gce-pd-controller-sa
  60. namespace: kube-system
  61. roleRef:
  62. kind: ClusterRole
  63. name: csi-gce-pd-provisioner-role
  64. apiGroup: rbac.authorization.k8s.io
  65. ---
  66. # xref: https://github.com/kubernetes-csi/external-attacher/blob/master/deploy/kubernetes/rbac.yaml
  67. kind: ClusterRole
  68. apiVersion: rbac.authorization.k8s.io/v1
  69. metadata:
  70. name: csi-gce-pd-attacher-role
  71. rules:
  72. - apiGroups: [""]
  73. resources: ["persistentvolumes"]
  74. verbs: ["get", "list", "watch", "update", "patch"]
  75. - apiGroups: [""]
  76. resources: ["nodes"]
  77. verbs: ["get", "list", "watch"]
  78. - apiGroups: ["storage.k8s.io"]
  79. resources: ["csinodes"]
  80. verbs: ["get", "list", "watch"]
  81. - apiGroups: ["storage.k8s.io"]
  82. resources: ["volumeattachments"]
  83. verbs: ["get", "list", "watch", "update", "patch"]
  84. - apiGroups: ["storage.k8s.io"]
  85. resources: ["volumeattachments/status"]
  86. verbs: ["patch"]
  87. ---
  88. kind: ClusterRoleBinding
  89. apiVersion: rbac.authorization.k8s.io/v1
  90. metadata:
  91. name: csi-gce-pd-controller-attacher-binding
  92. subjects:
  93. - kind: ServiceAccount
  94. name: csi-gce-pd-controller-sa
  95. namespace: kube-system
  96. roleRef:
  97. kind: ClusterRole
  98. name: csi-gce-pd-attacher-role
  99. apiGroup: rbac.authorization.k8s.io
  100. ---
  101. apiVersion: scheduling.k8s.io/v1
  102. kind: PriorityClass
  103. metadata:
  104. name: csi-gce-pd-controller
  105. value: 900000000
  106. globalDefault: false
  107. description: "This priority class should be used for the GCE PD CSI driver controller deployment only."
  108. ---
  109. apiVersion: scheduling.k8s.io/v1
  110. kind: PriorityClass
  111. metadata:
  112. name: csi-gce-pd-node
  113. value: 900001000
  114. globalDefault: false
  115. description: "This priority class should be used for the GCE PD CSI driver node deployment only."
  116. ---
  117. # Resizer must be able to work with PVCs, PVs, SCs.
  118. kind: ClusterRole
  119. apiVersion: rbac.authorization.k8s.io/v1
  120. metadata:
  121. name: csi-gce-pd-resizer-role
  122. rules:
  123. - apiGroups: [""]
  124. resources: ["persistentvolumes"]
  125. verbs: ["get", "list", "watch", "update", "patch"]
  126. - apiGroups: [""]
  127. resources: ["persistentvolumeclaims"]
  128. verbs: ["get", "list", "watch"]
  129. - apiGroups: [""]
  130. resources: ["persistentvolumeclaims/status"]
  131. verbs: ["update", "patch"]
  132. - apiGroups: [""]
  133. resources: ["events"]
  134. verbs: ["list", "watch", "create", "update", "patch"]
  135. # If handle-volume-inuse-error=true, the pod specific rbac is needed
  136. - apiGroups: [""]
  137. resources: ["pods"]
  138. verbs: ["get", "list", "watch"]
  139. ---
  140. kind: ClusterRoleBinding
  141. apiVersion: rbac.authorization.k8s.io/v1
  142. metadata:
  143. name: csi-gce-pd-resizer-binding
  144. subjects:
  145. - kind: ServiceAccount
  146. name: csi-gce-pd-controller-sa
  147. namespace: kube-system
  148. roleRef:
  149. kind: ClusterRole
  150. name: csi-gce-pd-resizer-role
  151. apiGroup: rbac.authorization.k8s.io
  152. ---
  153. apiVersion: rbac.authorization.k8s.io/v1
  154. kind: ClusterRoleBinding
  155. metadata:
  156. name: csi-gce-pd-controller
  157. roleRef:
  158. apiGroup: rbac.authorization.k8s.io
  159. kind: ClusterRole
  160. name: csi-gce-pd-node-deploy
  161. subjects:
  162. - kind: ServiceAccount
  163. name: csi-gce-pd-controller-sa
  164. namespace: kube-system
  165. ---
  166. apiVersion: rbac.authorization.k8s.io/v1
  167. kind: ClusterRole
  168. metadata:
  169. name: csi-gce-pd-snapshotter-role
  170. rules:
  171. - apiGroups: [""]
  172. resources: ["events"]
  173. verbs: ["list", "watch", "create", "update", "patch"]
  174. # Secrets resource omitted since GCE PD snapshots does not require them
  175. - apiGroups: ["snapshot.storage.k8s.io"]
  176. resources: ["volumesnapshotclasses"]
  177. verbs: ["get", "list", "watch"]
  178. - apiGroups: ["snapshot.storage.k8s.io"]
  179. resources: ["volumesnapshotcontents"]
  180. verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
  181. - apiGroups: ["snapshot.storage.k8s.io"]
  182. resources: ["volumesnapshotcontents/status"]
  183. verbs: ["update", "patch"]
  184. ---
  185. kind: ClusterRoleBinding
  186. apiVersion: rbac.authorization.k8s.io/v1
  187. metadata:
  188. name: csi-gce-pd-controller-snapshotter-binding
  189. subjects:
  190. - kind: ServiceAccount
  191. name: csi-gce-pd-controller-sa
  192. namespace: kube-system
  193. roleRef:
  194. kind: ClusterRole
  195. name: csi-gce-pd-snapshotter-role
  196. apiGroup: rbac.authorization.k8s.io
  197. ---
  198. kind: Role
  199. apiVersion: rbac.authorization.k8s.io/v1
  200. metadata:
  201. name: csi-gce-pd-leaderelection-role
  202. namespace: kube-system
  203. labels:
  204. k8s-app: gcp-compute-persistent-disk-csi-driver
  205. rules:
  206. - apiGroups: ["coordination.k8s.io"]
  207. resources: ["leases"]
  208. verbs: ["get", "watch", "list", "delete", "update", "create"]
  209. ---
  210. kind: RoleBinding
  211. apiVersion: rbac.authorization.k8s.io/v1
  212. metadata:
  213. name: csi-gce-pd-controller-leaderelection-binding
  214. namespace: kube-system
  215. labels:
  216. k8s-app: gcp-compute-persistent-disk-csi-driver
  217. subjects:
  218. - kind: ServiceAccount
  219. name: csi-gce-pd-controller-sa
  220. namespace: kube-system
  221. roleRef:
  222. kind: Role
  223. name: csi-gce-pd-leaderelection-role
  224. apiGroup: rbac.authorization.k8s.io