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.

180 lines
4.7 KiB

  1. # Controller Service
  2. apiVersion: v1
  3. kind: ServiceAccount
  4. metadata:
  5. name: ebs-csi-controller-sa
  6. namespace: kube-system
  7. ---
  8. kind: ClusterRole
  9. apiVersion: rbac.authorization.k8s.io/v1
  10. metadata:
  11. name: ebs-external-provisioner-role
  12. rules:
  13. - apiGroups: [""]
  14. resources: ["persistentvolumes"]
  15. verbs: ["list", "watch", "create", "delete"]
  16. - apiGroups: [""]
  17. resources: ["persistentvolumeclaims"]
  18. verbs: ["get", "list", "watch", "update"]
  19. - apiGroups: ["storage.k8s.io"]
  20. resources: ["storageclasses"]
  21. verbs: ["get", "list", "watch"]
  22. - apiGroups: [""]
  23. resources: ["events"]
  24. verbs: ["get", "list", "watch", "create", "update", "patch"]
  25. - apiGroups: ["storage.k8s.io"]
  26. resources: ["csinodes"]
  27. verbs: ["get", "list", "watch"]
  28. - apiGroups: [""]
  29. resources: ["nodes"]
  30. verbs: ["get", "list", "watch"]
  31. - apiGroups: ["coordination.k8s.io"]
  32. resources: ["leases"]
  33. verbs: ["get", "watch", "list", "delete", "update", "create"]
  34. ---
  35. kind: ClusterRoleBinding
  36. apiVersion: rbac.authorization.k8s.io/v1
  37. metadata:
  38. name: ebs-csi-provisioner-binding
  39. subjects:
  40. - kind: ServiceAccount
  41. name: ebs-csi-controller-sa
  42. namespace: kube-system
  43. roleRef:
  44. kind: ClusterRole
  45. name: ebs-external-provisioner-role
  46. apiGroup: rbac.authorization.k8s.io
  47. ---
  48. # The permissions in this ClusterRole are tightly coupled with the version of csi-attacher used. More information about this can be found in kubernetes-csi/external-attacher.
  49. kind: ClusterRole
  50. apiVersion: rbac.authorization.k8s.io/v1
  51. metadata:
  52. name: ebs-external-attacher-role
  53. rules:
  54. - apiGroups: [""]
  55. resources: ["persistentvolumes"]
  56. verbs: ["get", "list", "watch", "patch"]
  57. - apiGroups: ["storage.k8s.io"]
  58. resources: ["csinodes"]
  59. verbs: ["get", "list", "watch"]
  60. - apiGroups: ["storage.k8s.io"]
  61. resources: ["volumeattachments"]
  62. verbs: ["get", "list", "watch", "patch"]
  63. - apiGroups: ["storage.k8s.io"]
  64. resources: ["volumeattachments/status"]
  65. verbs: ["patch"]
  66. ---
  67. kind: ClusterRoleBinding
  68. apiVersion: rbac.authorization.k8s.io/v1
  69. metadata:
  70. name: ebs-csi-attacher-binding
  71. subjects:
  72. - kind: ServiceAccount
  73. name: ebs-csi-controller-sa
  74. namespace: kube-system
  75. roleRef:
  76. kind: ClusterRole
  77. name: ebs-external-attacher-role
  78. apiGroup: rbac.authorization.k8s.io
  79. {% if aws_ebs_csi_enable_volume_snapshot %}
  80. ---
  81. kind: ClusterRole
  82. apiVersion: rbac.authorization.k8s.io/v1
  83. metadata:
  84. name: ebs-external-snapshotter-role
  85. rules:
  86. - apiGroups: [""]
  87. resources: ["persistentvolumes"]
  88. verbs: ["get", "list", "watch"]
  89. - apiGroups: [""]
  90. resources: ["persistentvolumeclaims"]
  91. verbs: ["get", "list", "watch"]
  92. - apiGroups: ["storage.k8s.io"]
  93. resources: ["storageclasses"]
  94. verbs: ["get", "list", "watch"]
  95. - apiGroups: [""]
  96. resources: ["events"]
  97. verbs: ["list", "watch", "create", "update", "patch"]
  98. - apiGroups: [""]
  99. resources: ["secrets"]
  100. verbs: ["get", "list"]
  101. - apiGroups: ["snapshot.storage.k8s.io"]
  102. resources: ["volumesnapshotclasses"]
  103. verbs: ["get", "list", "watch"]
  104. - apiGroups: ["snapshot.storage.k8s.io"]
  105. resources: ["volumesnapshotcontents"]
  106. verbs: ["create", "get", "list", "watch", "update", "delete"]
  107. - apiGroups: ["snapshot.storage.k8s.io"]
  108. resources: ["volumesnapshots"]
  109. verbs: ["get", "list", "watch", "update"]
  110. - apiGroups: ["apiextensions.k8s.io"]
  111. resources: ["customresourcedefinitions"]
  112. verbs: ["create", "list", "watch", "delete"]
  113. ---
  114. kind: ClusterRoleBinding
  115. apiVersion: rbac.authorization.k8s.io/v1
  116. metadata:
  117. name: ebs-csi-snapshotter-binding
  118. subjects:
  119. - kind: ServiceAccount
  120. name: ebs-csi-controller-sa
  121. namespace: kube-system
  122. roleRef:
  123. kind: ClusterRole
  124. name: ebs-external-snapshotter-role
  125. apiGroup: rbac.authorization.k8s.io
  126. {% endif %}
  127. {% if aws_ebs_csi_enable_volume_resizing %}
  128. ---
  129. kind: ClusterRole
  130. apiVersion: rbac.authorization.k8s.io/v1
  131. metadata:
  132. name: ebs-external-resizer-role
  133. rules:
  134. - apiGroups: [""]
  135. resources: ["persistentvolumes"]
  136. verbs: ["get", "list", "watch", "update", "patch"]
  137. - apiGroups: [""]
  138. resources: ["persistentvolumeclaims"]
  139. verbs: ["get", "list", "watch"]
  140. - apiGroups: [""]
  141. resources: ["persistentvolumeclaims/status"]
  142. verbs: ["update", "patch"]
  143. - apiGroups: ["storage.k8s.io"]
  144. resources: ["storageclasses"]
  145. verbs: ["get", "list", "watch"]
  146. - apiGroups: [""]
  147. resources: ["events"]
  148. verbs: ["list", "watch", "create", "update", "patch"]
  149. ---
  150. kind: ClusterRoleBinding
  151. apiVersion: rbac.authorization.k8s.io/v1
  152. metadata:
  153. name: ebs-csi-resizer-binding
  154. subjects:
  155. - kind: ServiceAccount
  156. name: ebs-csi-controller-sa
  157. namespace: kube-system
  158. roleRef:
  159. kind: ClusterRole
  160. name: ebs-external-resizer-role
  161. apiGroup: rbac.authorization.k8s.io
  162. {% endif %}