csi-controller-rbac.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. ##### Controller Service Account, Roles, Rolebindings
  2. apiVersion: v1
  3. kind: ServiceAccount
  4. metadata:
  5. name: csi-gce-pd-controller-sa
  6. ---
  7. # xref: https://github.com/kubernetes-csi/external-provisioner/blob/master/deploy/kubernetes/rbac.yaml
  8. kind: ClusterRole
  9. apiVersion: rbac.authorization.k8s.io/v1
  10. metadata:
  11. name: csi-gce-pd-provisioner-role
  12. rules:
  13. - apiGroups: [""]
  14. resources: ["persistentvolumes"]
  15. verbs: ["get", "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: ["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: ["snapshot.storage.k8s.io"]
  32. resources: ["volumesnapshots"]
  33. verbs: ["get", "list"]
  34. - apiGroups: ["snapshot.storage.k8s.io"]
  35. resources: ["volumesnapshotcontents"]
  36. verbs: ["get", "list"]
  37. ---
  38. kind: ClusterRoleBinding
  39. apiVersion: rbac.authorization.k8s.io/v1
  40. metadata:
  41. name: csi-gce-pd-controller-provisioner-binding
  42. subjects:
  43. - kind: ServiceAccount
  44. name: csi-gce-pd-controller-sa
  45. roleRef:
  46. kind: ClusterRole
  47. name: csi-gce-pd-provisioner-role
  48. apiGroup: rbac.authorization.k8s.io
  49. ---
  50. # xref: https://github.com/kubernetes-csi/external-attacher/blob/master/deploy/kubernetes/rbac.yaml
  51. kind: ClusterRole
  52. apiVersion: rbac.authorization.k8s.io/v1
  53. metadata:
  54. name: csi-gce-pd-attacher-role
  55. rules:
  56. - apiGroups: [""]
  57. resources: ["persistentvolumes"]
  58. verbs: ["get", "list", "watch", "update", "patch"]
  59. - apiGroups: [""]
  60. resources: ["nodes"]
  61. verbs: ["get", "list", "watch"]
  62. - apiGroups: ["storage.k8s.io"]
  63. resources: ["csinodes"]
  64. verbs: ["get", "list", "watch"]
  65. - apiGroups: ["storage.k8s.io"]
  66. resources: ["volumeattachments"]
  67. verbs: ["get", "list", "watch", "update", "patch"]
  68. ---
  69. kind: ClusterRoleBinding
  70. apiVersion: rbac.authorization.k8s.io/v1
  71. metadata:
  72. name: csi-gce-pd-controller-attacher-binding
  73. subjects:
  74. - kind: ServiceAccount
  75. name: csi-gce-pd-controller-sa
  76. roleRef:
  77. kind: ClusterRole
  78. name: csi-gce-pd-attacher-role
  79. apiGroup: rbac.authorization.k8s.io
  80. ---
  81. # Resizer must be able to work with PVCs, PVs, SCs.
  82. kind: ClusterRole
  83. apiVersion: rbac.authorization.k8s.io/v1
  84. metadata:
  85. name: csi-gce-pd-resizer-role
  86. rules:
  87. - apiGroups: [""]
  88. resources: ["persistentvolumes"]
  89. verbs: ["get", "list", "watch", "update", "patch"]
  90. - apiGroups: [""]
  91. resources: ["persistentvolumeclaims"]
  92. verbs: ["get", "list", "watch"]
  93. - apiGroups: [""]
  94. resources: ["persistentvolumeclaims/status"]
  95. verbs: ["update", "patch"]
  96. - apiGroups: [""]
  97. resources: ["events"]
  98. verbs: ["list", "watch", "create", "update", "patch"]
  99. ---
  100. kind: ClusterRoleBinding
  101. apiVersion: rbac.authorization.k8s.io/v1
  102. metadata:
  103. name: csi-gce-pd-resizer-binding
  104. subjects:
  105. - kind: ServiceAccount
  106. name: csi-gce-pd-controller-sa
  107. roleRef:
  108. kind: ClusterRole
  109. name: csi-gce-pd-resizer-role
  110. apiGroup: rbac.authorization.k8s.io
  111. ---
  112. # xref: https://github.com/kubernetes-csi/external-snapshotter/blob/master/deploy/kubernetes/csi-snapshotter/rbac-csi-snapshotter.yaml
  113. kind: ClusterRole
  114. apiVersion: rbac.authorization.k8s.io/v1
  115. metadata:
  116. name: csi-gce-pd-snapshotter-role
  117. rules:
  118. - apiGroups: [""]
  119. resources: ["events"]
  120. verbs: ["list", "watch", "create", "update", "patch"]
  121. - apiGroups: ["snapshot.storage.k8s.io"]
  122. resources: ["volumesnapshotclasses"]
  123. verbs: ["get", "list", "watch"]
  124. - apiGroups: ["snapshot.storage.k8s.io"]
  125. resources: ["volumesnapshotcontents"]
  126. verbs: ["get", "list", "watch", "update", "delete", "patch"]
  127. - apiGroups: ["snapshot.storage.k8s.io"]
  128. resources: ["volumesnapshotcontents/status"]
  129. verbs: ["update", "patch"]
  130. ---
  131. kind: ClusterRoleBinding
  132. apiVersion: rbac.authorization.k8s.io/v1
  133. metadata:
  134. name: csi-gce-pd-controller-snapshotter-binding
  135. subjects:
  136. - kind: ServiceAccount
  137. name: csi-gce-pd-controller-sa
  138. roleRef:
  139. kind: ClusterRole
  140. name: csi-gce-pd-snapshotter-role
  141. apiGroup: rbac.authorization.k8s.io
  142. ---
  143. # priviledged Pod Security Policy, previously defined via PrivilegedTestPSPClusterRoleBinding()
  144. kind: ClusterRoleBinding
  145. apiVersion: rbac.authorization.k8s.io/v1
  146. metadata:
  147. name: psp-csi-controller-driver-registrar-role
  148. subjects:
  149. - kind: ServiceAccount
  150. name: csi-gce-pd-controller-sa
  151. roleRef:
  152. kind: ClusterRole
  153. name: e2e-test-privileged-psp
  154. apiGroup: rbac.authorization.k8s.io