2020-04-20 15:47:39 +00:00
|
|
|
kind: ServiceAccount
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
name: vsphere-csi-controller
|
|
|
|
namespace: kube-system
|
|
|
|
---
|
|
|
|
kind: ClusterRole
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: vsphere-csi-controller-role
|
|
|
|
rules:
|
|
|
|
- apiGroups: [""]
|
2021-05-04 07:05:11 +00:00
|
|
|
resources: ["nodes", "persistentvolumeclaims", "pods", "configmaps"]
|
2020-04-20 15:47:39 +00:00
|
|
|
verbs: ["get", "list", "watch"]
|
2021-05-04 07:05:11 +00:00
|
|
|
{% if external_vsphere_version >= "7.0" %}
|
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumeclaims/status"]
|
|
|
|
{% if external_vsphere_version >= "7.0u1" %}
|
|
|
|
verbs: ["patch"]
|
|
|
|
{% else %}
|
|
|
|
verbs: ["update", "patch"]
|
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
2020-04-20 15:47:39 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["persistentvolumes"]
|
2021-05-04 07:05:11 +00:00
|
|
|
verbs: ["get", "list", "watch", "create", "update", "delete", "patch"]
|
2020-04-20 15:47:39 +00:00
|
|
|
- apiGroups: [""]
|
|
|
|
resources: ["events"]
|
|
|
|
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
2021-05-04 07:05:11 +00:00
|
|
|
{% if vsphere_csi_controller is version('v2.0.0', '>=') %}
|
|
|
|
- apiGroups: ["coordination.k8s.io"]
|
|
|
|
resources: ["leases"]
|
|
|
|
verbs: ["get", "watch", "list", "delete", "update", "create"]
|
|
|
|
{% endif %}
|
2020-04-20 15:47:39 +00:00
|
|
|
- apiGroups: ["storage.k8s.io"]
|
2021-05-04 07:05:11 +00:00
|
|
|
resources: ["storageclasses","csinodes"]
|
2020-04-20 15:47:39 +00:00
|
|
|
verbs: ["get", "list", "watch"]
|
|
|
|
- apiGroups: ["storage.k8s.io"]
|
|
|
|
resources: ["volumeattachments"]
|
2021-05-04 07:05:11 +00:00
|
|
|
verbs: ["get", "list", "watch", "patch"]
|
|
|
|
{% if external_vsphere_version >= "7.0u1" %}
|
|
|
|
- apiGroups: ["cns.vmware.com"]
|
|
|
|
resources: ["cnsvspherevolumemigrations"]
|
|
|
|
verbs: ["create", "get", "list", "watch", "update", "delete"]
|
|
|
|
- apiGroups: ["apiextensions.k8s.io"]
|
|
|
|
resources: ["customresourcedefinitions"]
|
|
|
|
verbs: ["get", "create"]
|
|
|
|
{% endif %}
|
|
|
|
{% if vsphere_csi_controller is version('v2.0.0', '>=') %}
|
|
|
|
- apiGroups: ["storage.k8s.io"]
|
|
|
|
resources: ["volumeattachments/status"]
|
|
|
|
verbs: ["patch"]
|
|
|
|
{% endif %}
|
2020-04-20 15:47:39 +00:00
|
|
|
---
|
|
|
|
kind: ClusterRoleBinding
|
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
|
|
|
metadata:
|
|
|
|
name: vsphere-csi-controller-binding
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: vsphere-csi-controller
|
|
|
|
namespace: kube-system
|
|
|
|
roleRef:
|
|
|
|
kind: ClusterRole
|
|
|
|
name: vsphere-csi-controller-role
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|