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.

212 lines
5.5 KiB

  1. # This YAML file contains RBAC API objects,
  2. # which are necessary to run csi controller plugin
  3. apiVersion: v1
  4. kind: ServiceAccount
  5. metadata:
  6. name: csi-cinder-controller-sa
  7. namespace: kube-system
  8. ---
  9. # external attacher
  10. kind: ClusterRole
  11. apiVersion: rbac.authorization.k8s.io/v1
  12. metadata:
  13. name: csi-attacher-role
  14. rules:
  15. - apiGroups: [""]
  16. resources: ["persistentvolumes"]
  17. verbs: ["get", "list", "watch", "update", "patch"]
  18. - apiGroups: [""]
  19. resources: ["nodes"]
  20. verbs: ["get", "list", "watch"]
  21. - apiGroups: ["storage.k8s.io"]
  22. resources: ["volumeattachments"]
  23. verbs: ["get", "list", "watch", "update", "patch"]
  24. - apiGroups: ["storage.k8s.io"]
  25. resources: ["csinodes"]
  26. verbs: ["get", "list", "watch"]
  27. ---
  28. kind: ClusterRoleBinding
  29. apiVersion: rbac.authorization.k8s.io/v1
  30. metadata:
  31. name: csi-attacher-binding
  32. subjects:
  33. - kind: ServiceAccount
  34. name: csi-cinder-controller-sa
  35. namespace: kube-system
  36. roleRef:
  37. kind: ClusterRole
  38. name: csi-attacher-role
  39. apiGroup: rbac.authorization.k8s.io
  40. ---
  41. # external Provisioner
  42. kind: ClusterRole
  43. apiVersion: rbac.authorization.k8s.io/v1
  44. metadata:
  45. name: csi-provisioner-role
  46. rules:
  47. - apiGroups: [""]
  48. resources: ["persistentvolumes"]
  49. verbs: ["get", "list", "watch", "create", "delete"]
  50. - apiGroups: [""]
  51. resources: ["persistentvolumeclaims"]
  52. verbs: ["get", "list", "watch", "update"]
  53. - apiGroups: ["storage.k8s.io"]
  54. resources: ["storageclasses"]
  55. verbs: ["get", "list", "watch"]
  56. - apiGroups: [""]
  57. resources: ["nodes"]
  58. verbs: ["get", "list", "watch"]
  59. - apiGroups: ["storage.k8s.io"]
  60. resources: ["csinodes"]
  61. verbs: ["get", "list", "watch"]
  62. - apiGroups: [""]
  63. resources: ["events"]
  64. verbs: ["list", "watch", "create", "update", "patch"]
  65. - apiGroups: ["snapshot.storage.k8s.io"]
  66. resources: ["volumesnapshots"]
  67. verbs: ["get", "list"]
  68. - apiGroups: ["snapshot.storage.k8s.io"]
  69. resources: ["volumesnapshotcontents"]
  70. verbs: ["get", "list"]
  71. ---
  72. kind: ClusterRoleBinding
  73. apiVersion: rbac.authorization.k8s.io/v1
  74. metadata:
  75. name: csi-provisioner-binding
  76. subjects:
  77. - kind: ServiceAccount
  78. name: csi-cinder-controller-sa
  79. namespace: kube-system
  80. roleRef:
  81. kind: ClusterRole
  82. name: csi-provisioner-role
  83. apiGroup: rbac.authorization.k8s.io
  84. ---
  85. # external snapshotter
  86. kind: ClusterRole
  87. apiVersion: rbac.authorization.k8s.io/v1
  88. metadata:
  89. name: csi-snapshotter-role
  90. rules:
  91. - apiGroups: [""]
  92. resources: ["persistentvolumes"]
  93. verbs: ["get", "list", "watch"]
  94. - apiGroups: [""]
  95. resources: ["persistentvolumeclaims"]
  96. verbs: ["get", "list", "watch"]
  97. - apiGroups: ["storage.k8s.io"]
  98. resources: ["storageclasses"]
  99. verbs: ["get", "list", "watch"]
  100. - apiGroups: [""]
  101. resources: ["events"]
  102. verbs: ["list", "watch", "create", "update", "patch"]
  103. - apiGroups: [""]
  104. resources: ["secrets"]
  105. verbs: ["get", "list"]
  106. - apiGroups: ["snapshot.storage.k8s.io"]
  107. resources: ["volumesnapshotclasses"]
  108. verbs: ["get", "list", "watch"]
  109. - apiGroups: ["snapshot.storage.k8s.io"]
  110. resources: ["volumesnapshotcontents"]
  111. verbs: ["create", "get", "list", "watch", "update", "delete"]
  112. - apiGroups: ["snapshot.storage.k8s.io"]
  113. resources: ["volumesnapshots"]
  114. verbs: ["get", "list", "watch", "update"]
  115. - apiGroups: ["snapshot.storage.k8s.io"]
  116. resources: ["volumesnapshots/status"]
  117. verbs: ["update"]
  118. - apiGroups: ["snapshot.storage.k8s.io"]
  119. resources: ["volumesnapshotcontents/status"]
  120. verbs: ["update"]
  121. - apiGroups: ["apiextensions.k8s.io"]
  122. resources: ["customresourcedefinitions"]
  123. verbs: ["create", "list", "watch", "delete"]
  124. ---
  125. kind: ClusterRoleBinding
  126. apiVersion: rbac.authorization.k8s.io/v1
  127. metadata:
  128. name: csi-snapshotter-binding
  129. subjects:
  130. - kind: ServiceAccount
  131. name: csi-cinder-controller-sa
  132. namespace: kube-system
  133. roleRef:
  134. kind: ClusterRole
  135. name: csi-snapshotter-role
  136. apiGroup: rbac.authorization.k8s.io
  137. ---
  138. # External Resizer
  139. kind: ClusterRole
  140. apiVersion: rbac.authorization.k8s.io/v1
  141. metadata:
  142. name: csi-resizer-role
  143. rules:
  144. # The following rule should be uncommented for plugins that require secrets
  145. # for provisioning.
  146. # - apiGroups: [""]
  147. # resources: ["secrets"]
  148. # verbs: ["get", "list", "watch"]
  149. - apiGroups: [""]
  150. resources: ["persistentvolumes"]
  151. verbs: ["get", "list", "watch", "update", "patch"]
  152. - apiGroups: [""]
  153. resources: ["persistentvolumeclaims"]
  154. verbs: ["get", "list", "watch"]
  155. - apiGroups: [""]
  156. resources: ["persistentvolumeclaims/status"]
  157. verbs: ["update", "patch"]
  158. - apiGroups: ["storage.k8s.io"]
  159. resources: ["storageclasses"]
  160. verbs: ["get", "list", "watch"]
  161. - apiGroups: [""]
  162. resources: ["events"]
  163. verbs: ["list", "watch", "create", "update", "patch"]
  164. ---
  165. kind: ClusterRoleBinding
  166. apiVersion: rbac.authorization.k8s.io/v1
  167. metadata:
  168. name: csi-resizer-binding
  169. subjects:
  170. - kind: ServiceAccount
  171. name: csi-cinder-controller-sa
  172. namespace: kube-system
  173. roleRef:
  174. kind: ClusterRole
  175. name: csi-resizer-role
  176. apiGroup: rbac.authorization.k8s.io
  177. ---
  178. kind: Role
  179. apiVersion: rbac.authorization.k8s.io/v1
  180. metadata:
  181. namespace: kube-system
  182. name: external-resizer-cfg
  183. rules:
  184. - apiGroups: ["coordination.k8s.io"]
  185. resources: ["leases"]
  186. verbs: ["get", "watch", "list", "delete", "update", "create"]
  187. ---
  188. kind: RoleBinding
  189. apiVersion: rbac.authorization.k8s.io/v1
  190. metadata:
  191. name: csi-resizer-role-cfg
  192. namespace: kube-system
  193. subjects:
  194. - kind: ServiceAccount
  195. name: csi-cinder-controller-sa
  196. namespace: kube-system
  197. roleRef:
  198. kind: Role
  199. name: external-resizer-cfg
  200. apiGroup: rbac.authorization.k8s.io