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.

248 lines
6.6 KiB

  1. kind: ServiceAccount
  2. apiVersion: v1
  3. metadata:
  4. name: csi-upcloud-controller-sa
  5. namespace: kube-system
  6. ---
  7. apiVersion: v1
  8. kind: ServiceAccount
  9. metadata:
  10. name: csi-upcloud-node-sa
  11. namespace: kube-system
  12. ---
  13. kind: ClusterRole
  14. apiVersion: rbac.authorization.k8s.io/v1
  15. metadata:
  16. name: csi-upcloud-node-driver-registrar-role
  17. namespace: kube-system
  18. rules:
  19. - apiGroups: [ "" ]
  20. resources: [ "events" ]
  21. verbs: [ "get", "list", "watch", "create", "update", "patch" ]
  22. ---
  23. kind: ClusterRoleBinding
  24. apiVersion: rbac.authorization.k8s.io/v1
  25. metadata:
  26. name: csi-upcloud-node-driver-registrar-binding
  27. subjects:
  28. - kind: ServiceAccount
  29. name: csi-upcloud-node-sa
  30. namespace: kube-system
  31. roleRef:
  32. kind: ClusterRole
  33. name: csi-upcloud-node-driver-registrar-role
  34. apiGroup: rbac.authorization.k8s.io
  35. ---
  36. kind: ClusterRole
  37. apiVersion: rbac.authorization.k8s.io/v1
  38. metadata:
  39. name: csi-upcloud-provisioner-role
  40. rules:
  41. - apiGroups: [ "" ]
  42. resources: [ "secrets" ]
  43. verbs: [ "get", "list" ]
  44. - apiGroups: [ "" ]
  45. resources: [ "persistentvolumes" ]
  46. verbs: [ "get", "list", "watch", "create", "delete" ]
  47. - apiGroups: [ "" ]
  48. resources: [ "persistentvolumeclaims" ]
  49. verbs: [ "get", "list", "watch", "update" ]
  50. - apiGroups: [ "storage.k8s.io" ]
  51. resources: [ "storageclasses" ]
  52. verbs: [ "get", "list", "watch" ]
  53. - apiGroups: [ "storage.k8s.io" ]
  54. resources: [ "csinodes" ]
  55. verbs: [ "get", "list", "watch" ]
  56. - apiGroups: [ "" ]
  57. resources: [ "events" ]
  58. verbs: [ "list", "watch", "create", "update", "patch" ]
  59. - apiGroups: ["snapshot.storage.k8s.io"]
  60. resources: ["volumesnapshotclasses"]
  61. verbs: ["get", "list", "watch"]
  62. - apiGroups: ["snapshot.storage.k8s.io"]
  63. resources: ["volumesnapshotcontents"]
  64. verbs: ["create", "get", "list", "watch", "update", "delete", "patch"]
  65. - apiGroups: ["snapshot.storage.k8s.io"]
  66. resources: ["volumesnapshotcontents/status"]
  67. verbs: ["update"]
  68. - apiGroups: [ "snapshot.storage.k8s.io" ]
  69. resources: [ "volumesnapshots" ]
  70. verbs: [ "get", "list" ]
  71. - apiGroups: [ "" ]
  72. resources: [ "nodes" ]
  73. verbs: [ "get", "list", "watch" ]
  74. ---
  75. kind: ClusterRoleBinding
  76. apiVersion: rbac.authorization.k8s.io/v1
  77. metadata:
  78. name: csi-upcloud-provisioner-binding
  79. subjects:
  80. - kind: ServiceAccount
  81. name: csi-upcloud-controller-sa
  82. namespace: kube-system
  83. roleRef:
  84. kind: ClusterRole
  85. name: csi-upcloud-provisioner-role
  86. apiGroup: rbac.authorization.k8s.io
  87. ---
  88. # Attacher must be able to work with PVs, nodes and VolumeAttachments
  89. kind: ClusterRole
  90. apiVersion: rbac.authorization.k8s.io/v1
  91. metadata:
  92. name: csi-upcloud-attacher-role
  93. rules:
  94. - apiGroups: [ "" ]
  95. resources: [ "persistentvolumes" ]
  96. verbs: [ "get", "list", "watch", "update", "patch" ]
  97. - apiGroups: [ "" ]
  98. resources: [ "nodes" ]
  99. verbs: [ "get", "list", "watch" ]
  100. - apiGroups: [ "storage.k8s.io" ]
  101. resources: [ "csinodes" ]
  102. verbs: [ "get", "list", "watch" ]
  103. - apiGroups: [ "storage.k8s.io" ]
  104. resources: [ "volumeattachments" ]
  105. verbs: [ "get", "list", "watch", "update", "patch" ]
  106. - apiGroups: [ "storage.k8s.io" ]
  107. resources: [ "volumeattachments/status" ]
  108. verbs: [ "get", "list", "watch", "update", "patch" ]
  109. ---
  110. kind: ClusterRoleBinding
  111. apiVersion: rbac.authorization.k8s.io/v1
  112. metadata:
  113. name: csi-upcloud-attacher-binding
  114. subjects:
  115. - kind: ServiceAccount
  116. name: csi-upcloud-controller-sa
  117. namespace: kube-system
  118. roleRef:
  119. kind: ClusterRole
  120. name: csi-upcloud-attacher-role
  121. apiGroup: rbac.authorization.k8s.io
  122. ---
  123. # Provisioner must be able to work with endpoints and leases in current namespace
  124. # if (and only if) leadership election is enabled
  125. kind: Role
  126. apiVersion: rbac.authorization.k8s.io/v1
  127. metadata:
  128. namespace: kube-system
  129. name: csi-upcloud-provisioner-cfg-role
  130. rules:
  131. - apiGroups: [""]
  132. resources: ["endpoints"]
  133. verbs: ["get", "watch", "list", "delete", "update", "create"]
  134. - apiGroups: ["coordination.k8s.io"]
  135. resources: ["leases"]
  136. verbs: ["get", "watch", "list", "delete", "update", "create"]
  137. ---
  138. kind: RoleBinding
  139. apiVersion: rbac.authorization.k8s.io/v1
  140. metadata:
  141. name: csi-provisioner-role-cfg-binding
  142. namespace: kube-system
  143. subjects:
  144. - kind: ServiceAccount
  145. name: csi-upcloud-controller-sa
  146. namespace: kube-system
  147. roleRef:
  148. kind: Role
  149. name: csi-upcloud-provisioner-cfg-role
  150. apiGroup: rbac.authorization.k8s.io
  151. ---
  152. kind: ClusterRole
  153. apiVersion: rbac.authorization.k8s.io/v1
  154. metadata:
  155. name: csi-upcloud-resizer-role
  156. rules:
  157. - apiGroups: [ "" ]
  158. resources: [ "persistentvolumes" ]
  159. verbs: [ "get", "list", "watch", "update", "patch" ]
  160. - apiGroups: [ "" ]
  161. resources: [ "persistentvolumeclaims" ]
  162. verbs: [ "get", "list", "watch" ]
  163. - apiGroups: [ "" ]
  164. resources: [ "persistentvolumeclaims/status" ]
  165. verbs: [ "update", "patch" ]
  166. - apiGroups: [ "" ]
  167. resources: [ "events" ]
  168. verbs: [ "list", "watch", "create", "update", "patch" ]
  169. - apiGroups: [ "" ]
  170. resources: [ "pods" ]
  171. verbs: [ "watch", "list" ]
  172. ---
  173. kind: ClusterRoleBinding
  174. apiVersion: rbac.authorization.k8s.io/v1
  175. metadata:
  176. name: csi-upcloud-resizer-binding
  177. subjects:
  178. - kind: ServiceAccount
  179. name: csi-upcloud-controller-sa
  180. namespace: kube-system
  181. roleRef:
  182. kind: ClusterRole
  183. name: csi-upcloud-resizer-role
  184. apiGroup: rbac.authorization.k8s.io
  185. ---
  186. kind: ClusterRole
  187. apiVersion: rbac.authorization.k8s.io/v1
  188. metadata:
  189. name: csi-upcloud-snapshotter-role
  190. rules:
  191. - apiGroups: [""]
  192. resources: ["secrets"]
  193. verbs: ["get", "list"]
  194. - apiGroups: [""]
  195. resources: ["persistentvolumes"]
  196. verbs: ["get", "list", "watch", "create", "delete"]
  197. - apiGroups: [""]
  198. resources: ["persistentvolumeclaims"]
  199. verbs: ["get", "list", "watch", "update"]
  200. - apiGroups: ["storage.k8s.io"]
  201. resources: ["storageclasses"]
  202. verbs: ["get", "list", "watch"]
  203. - apiGroups: [""]
  204. resources: ["events"]
  205. verbs: ["list", "watch", "create", "update", "patch"]
  206. - apiGroups: ["snapshot.storage.k8s.io"]
  207. resources: ["volumesnapshots"]
  208. verbs: ["get", "list"]
  209. - apiGroups: ["snapshot.storage.k8s.io"]
  210. resources: ["volumesnapshotcontents"]
  211. verbs: ["get", "list"]
  212. - apiGroups: ["storage.k8s.io"]
  213. resources: ["csinodes"]
  214. verbs: ["get", "list", "watch"]
  215. - apiGroups: [""]
  216. resources: ["nodes"]
  217. verbs: ["get", "list", "watch"]
  218. - apiGroups: ["storage.k8s.io"]
  219. resources: ["volumeattachments"]
  220. verbs: ["get", "list", "watch"]
  221. ---
  222. kind: ClusterRoleBinding
  223. apiVersion: rbac.authorization.k8s.io/v1
  224. metadata:
  225. name: csi-upcloud-snapshotter-binding
  226. subjects:
  227. - kind: ServiceAccount
  228. name: csi-upcloud-controller-sa
  229. namespace: kube-system
  230. roleRef:
  231. kind: ClusterRole
  232. name: csi-upcloud-snapshotter-role
  233. apiGroup: rbac.authorization.k8s.io