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.

89 lines
3.0 KiB

  1. kind: ServiceAccount
  2. apiVersion: v1
  3. metadata:
  4. name: vsphere-csi-controller
  5. namespace: "{{ vsphere_csi_namespace }}"
  6. ---
  7. kind: ClusterRole
  8. apiVersion: rbac.authorization.k8s.io/v1
  9. metadata:
  10. name: vsphere-csi-controller-role
  11. rules:
  12. - apiGroups: [""]
  13. resources: ["nodes", "pods"]
  14. verbs: ["get", "list", "watch"]
  15. - apiGroups: [""]
  16. resources: ["configmaps"]
  17. verbs: ["get", "list", "watch", "create"]
  18. - apiGroups: [""]
  19. resources: ["persistentvolumeclaims"]
  20. verbs: ["get", "list", "watch", "update"]
  21. {% if external_vsphere_version >= "7.0" %}
  22. - apiGroups: [""]
  23. resources: ["persistentvolumeclaims/status"]
  24. {% if external_vsphere_version >= "7.0u1" %}
  25. verbs: ["patch"]
  26. {% else %}
  27. verbs: ["update", "patch"]
  28. {% endif %}
  29. {% endif %}
  30. - apiGroups: [""]
  31. resources: ["persistentvolumes"]
  32. verbs: ["get", "list", "watch", "create", "update", "delete", "patch"]
  33. - apiGroups: [""]
  34. resources: ["events"]
  35. verbs: ["get", "list", "watch", "create", "update", "patch"]
  36. {% if vsphere_csi_controller is version('v2.0.0', '>=') %}
  37. - apiGroups: ["coordination.k8s.io"]
  38. resources: ["leases"]
  39. verbs: ["get", "watch", "list", "delete", "update", "create"]
  40. {% endif %}
  41. - apiGroups: ["storage.k8s.io"]
  42. resources: ["storageclasses","csinodes"]
  43. verbs: ["get", "list", "watch"]
  44. - apiGroups: ["storage.k8s.io"]
  45. resources: ["volumeattachments"]
  46. verbs: ["get", "list", "watch", "patch", "update"]
  47. - apiGroups: ["cns.vmware.com"]
  48. resources: ["triggercsifullsyncs"]
  49. verbs: ["create", "get", "update", "watch", "list"]
  50. - apiGroups: ["cns.vmware.com"]
  51. resources: ["cnsvspherevolumemigrations"]
  52. verbs: ["create", "get", "list", "watch", "update", "delete"]
  53. - apiGroups: ["apiextensions.k8s.io"]
  54. resources: ["customresourcedefinitions"]
  55. verbs: ["get", "create", "update"]
  56. - apiGroups: ["cns.vmware.com"]
  57. resources: ["cnsvolumeoperationrequests"]
  58. verbs: ["create", "get", "list", "update", "delete"]
  59. - apiGroups: [ "cns.vmware.com" ]
  60. resources: [ "csinodetopologies" ]
  61. verbs: ["get", "update", "watch", "list"]
  62. - apiGroups: ["storage.k8s.io"]
  63. resources: ["volumeattachments/status"]
  64. verbs: ["patch"]
  65. - apiGroups: [ "snapshot.storage.k8s.io" ]
  66. resources: [ "volumesnapshots" ]
  67. verbs: [ "get", "list" ]
  68. - apiGroups: [ "snapshot.storage.k8s.io" ]
  69. resources: [ "volumesnapshotclasses" ]
  70. verbs: [ "watch", "get", "list" ]
  71. - apiGroups: [ "snapshot.storage.k8s.io" ]
  72. resources: [ "volumesnapshotcontents" ]
  73. verbs: [ "create", "get", "list", "watch", "update", "delete", "patch" ]
  74. - apiGroups: [ "snapshot.storage.k8s.io" ]
  75. resources: [ "volumesnapshotcontents/status" ]
  76. verbs: [ "update", "patch" ]
  77. ---
  78. kind: ClusterRoleBinding
  79. apiVersion: rbac.authorization.k8s.io/v1
  80. metadata:
  81. name: vsphere-csi-controller-binding
  82. subjects:
  83. - kind: ServiceAccount
  84. name: vsphere-csi-controller
  85. namespace: "{{ vsphere_csi_namespace }}"
  86. roleRef:
  87. kind: ClusterRole
  88. name: vsphere-csi-controller-role
  89. apiGroup: rbac.authorization.k8s.io