001-rbac.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. name: nfs-client-provisioner
  5. # replace with namespace where provisioner is deployed
  6. namespace: default
  7. ---
  8. kind: ClusterRole
  9. apiVersion: rbac.authorization.k8s.io/v1
  10. metadata:
  11. name: nfs-client-provisioner-runner
  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: ["create", "update", "patch"]
  25. ---
  26. kind: ClusterRoleBinding
  27. apiVersion: rbac.authorization.k8s.io/v1
  28. metadata:
  29. name: run-nfs-client-provisioner
  30. subjects:
  31. - kind: ServiceAccount
  32. name: nfs-client-provisioner
  33. # replace with namespace where provisioner is deployed
  34. namespace: default
  35. roleRef:
  36. kind: ClusterRole
  37. name: nfs-client-provisioner-runner
  38. apiGroup: rbac.authorization.k8s.io
  39. ---
  40. kind: Role
  41. apiVersion: rbac.authorization.k8s.io/v1
  42. metadata:
  43. name: leader-locking-nfs-client-provisioner
  44. # replace with namespace where provisioner is deployed
  45. namespace: default
  46. rules:
  47. - apiGroups: [""]
  48. resources: ["endpoints"]
  49. verbs: ["get", "list", "watch", "create", "update", "patch"]
  50. ---
  51. kind: RoleBinding
  52. apiVersion: rbac.authorization.k8s.io/v1
  53. metadata:
  54. name: leader-locking-nfs-client-provisioner
  55. # replace with namespace where provisioner is deployed
  56. namespace: default
  57. subjects:
  58. - kind: ServiceAccount
  59. name: nfs-client-provisioner
  60. # replace with namespace where provisioner is deployed
  61. namespace: default
  62. roleRef:
  63. kind: Role
  64. name: leader-locking-nfs-client-provisioner
  65. apiGroup: rbac.authorization.k8s.io