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.

85 lines
2.4 KiB

  1. # RBAC file for the snapshot controller.
  2. #
  3. # The snapshot controller implements the control loop for CSI snapshot functionality.
  4. # It should be installed as part of the base Kubernetes distribution in an appropriate
  5. # namespace for components implementing base system functionality. For installing with
  6. # Vanilla Kubernetes, kube-system makes sense for the namespace.
  7. apiVersion: v1
  8. kind: ServiceAccount
  9. metadata:
  10. name: snapshot-controller
  11. namespace: kube-system
  12. ---
  13. kind: ClusterRole
  14. apiVersion: rbac.authorization.k8s.io/v1
  15. metadata:
  16. # rename if there are conflicts
  17. name: snapshot-controller-runner
  18. rules:
  19. - apiGroups: [""]
  20. resources: ["persistentvolumes"]
  21. verbs: ["get", "list", "watch"]
  22. - apiGroups: [""]
  23. resources: ["persistentvolumeclaims"]
  24. verbs: ["get", "list", "watch", "update"]
  25. - apiGroups: ["storage.k8s.io"]
  26. resources: ["storageclasses"]
  27. verbs: ["get", "list", "watch"]
  28. - apiGroups: [""]
  29. resources: ["events"]
  30. verbs: ["list", "watch", "create", "update", "patch"]
  31. - apiGroups: ["snapshot.storage.k8s.io"]
  32. resources: ["volumesnapshotclasses"]
  33. verbs: ["get", "list", "watch"]
  34. - apiGroups: ["snapshot.storage.k8s.io"]
  35. resources: ["volumesnapshotcontents"]
  36. verbs: ["create", "get", "list", "watch", "update", "delete"]
  37. - apiGroups: ["snapshot.storage.k8s.io"]
  38. resources: ["volumesnapshots"]
  39. verbs: ["get", "list", "watch", "update"]
  40. - apiGroups: ["snapshot.storage.k8s.io"]
  41. resources: ["volumesnapshots/status"]
  42. verbs: ["update"]
  43. ---
  44. kind: ClusterRoleBinding
  45. apiVersion: rbac.authorization.k8s.io/v1
  46. metadata:
  47. name: snapshot-controller-role
  48. subjects:
  49. - kind: ServiceAccount
  50. name: snapshot-controller
  51. namespace: kube-system
  52. roleRef:
  53. kind: ClusterRole
  54. # change the name also here if the ClusterRole gets renamed
  55. name: snapshot-controller-runner
  56. apiGroup: rbac.authorization.k8s.io
  57. ---
  58. kind: Role
  59. apiVersion: rbac.authorization.k8s.io/v1
  60. metadata:
  61. namespace: kube-system
  62. name: snapshot-controller-leaderelection
  63. rules:
  64. - apiGroups: ["coordination.k8s.io"]
  65. resources: ["leases"]
  66. verbs: ["get", "watch", "list", "delete", "update", "create"]
  67. ---
  68. kind: RoleBinding
  69. apiVersion: rbac.authorization.k8s.io/v1
  70. metadata:
  71. name: snapshot-controller-leaderelection
  72. namespace: kube-system
  73. subjects:
  74. - kind: ServiceAccount
  75. name: snapshot-controller
  76. namespace: kube-system
  77. roleRef:
  78. kind: Role
  79. name: snapshot-controller-leaderelection
  80. apiGroup: rbac.authorization.k8s.io