apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  creationTimestamp: null
  name: {{ include "mcs-controller-manager.fullname" . }}-role
rules:
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - create
  - get
  - list
  - update
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create
  - get
  - list
  - update
  - watch
  - patch
- apiGroups:
  - ""
  resources:
  - services
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - get
  - list
- apiGroups:
  - networking.fleet.azure.com
  resources:
  - multiclusterservices
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch
- apiGroups:
  - networking.fleet.azure.com
  resources:
  - multiclusterservices/finalizers
  verbs:
  - get
  - update
- apiGroups:
  - networking.fleet.azure.com
  resources:
  - multiclusterservices/status
  verbs:
  - get
  - patch
  - update
- apiGroups:
  - networking.fleet.azure.com
  resources:
  - serviceimports
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: {{ include "mcs-controller-manager.fullname" . }}-role-binding
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: {{ include "mcs-controller-manager.fullname" . }}-role
subjects:
  - kind: ServiceAccount
    name: {{ include "mcs-controller-manager.fullname" . }}-sa
    namespace: {{ .Values.fleetSystemNamespace }}
