{{- if .Values.cloudControllerManager.rbac.enabled -}} # Source: https://github.com/kubernetes/cloud-provider-vsphere/blob/master/releases/v1.19/vsphere-cloud-controller-manager.yaml apiVersion: v1 kind: ServiceAccount metadata: name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole metadata: name: {{ .Chart.Name }}-cloud-controller-manager rules: - apiGroups: - "" resources: - events verbs: - create - patch - update - apiGroups: - "" resources: - nodes verbs: - '*' - apiGroups: - "" resources: - nodes/status verbs: - patch - apiGroups: - "" resources: - services verbs: - list - patch - update - watch - apiGroups: - "" resources: - services/status verbs: - patch - apiGroups: - "" resources: - serviceaccounts verbs: - create - get - list - watch - update - apiGroups: - "" resources: - persistentvolumes verbs: - get - list - update - watch - apiGroups: - "" resources: - endpoints verbs: - create - get - list - watch - update - apiGroups: - "" resources: - secrets verbs: - get - list - watch - apiGroups: - "coordination.k8s.io" resources: - leases verbs: - get - list - watch - create - update --- apiVersion: rbac.authorization.k8s.io/v1 kind: RoleBinding metadata: name: apiserver-authentication-reader namespace: kube-system roleRef: apiGroup: rbac.authorization.k8s.io kind: Role name: extension-apiserver-authentication-reader subjects: - apiGroup: "" kind: ServiceAccount name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} - apiGroup: "" kind: User name: {{ .Chart.Name }}-cloud-controller-manager --- apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRoleBinding metadata: name: {{ .Chart.Name }}-cloud-controller-manager roleRef: apiGroup: rbac.authorization.k8s.io kind: ClusterRole name: {{ .Chart.Name }}-cloud-controller-manager subjects: - kind: ServiceAccount name: {{ .Chart.Name }}-cloud-controller-manager namespace: {{ .Release.Namespace }} - kind: User name: {{ .Chart.Name }}-cloud-controller-manager {{- end -}}