---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: gardener-extension-shoot-fleet-agent
  labels:
    app.kubernetes.io/name: gardener-extension-shoot-fleet-agent
    helm.sh/chart: gardener-extension-shoot-fleet-agent
    app.kubernetes.io/instance: {{ .Release.Name }}
rules:
- apiGroups:
  - extensions.gardener.cloud
  resources:
  - clusters
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - extensions.gardener.cloud
  resources:
  - extensions
  - extensions/status
  verbs:
  - get
  - list
  - watch
  - patch
  - update
- apiGroups:
  - ""
  resources:
  - namespaces
  verbs:
  - get
  - list
  - watch
- apiGroups:
  - apiextensions.k8s.io
  resources:
  - customresourcedefinitions
  verbs:
  - get
  - create
  - update
  - patch
- apiGroups:
  - rbac.authorization.k8s.io
  resources:
  - clusterroles
  - clusterrolebindings
  - roles
  - rolebindings
  verbs:
  - get
  - create
  - update
  - patch
  - delete
- apiGroups:
  - ""
  resources:
  - "configmaps"
  - "secrets"
  - "events"
  - "services"
  - "pods"
  - "serviceaccounts"
  verbs:
  - "*"
- apiGroups:
  - "apps"
  resources:
  - "deployments"
  verbs:
  - get
  - create
  - update
  - patch
  - delete
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  verbs:
  - create
- apiGroups:
  - coordination.k8s.io
  resources:
  - leases
  resourceNames:
  - {{ include "leaderelectionid" . }}
  verbs:
  - update
  - get
  - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: gardener-extension-shoot-fleet-agent
  labels:
    app.kubernetes.io/name: gardener-extension-shoot-fleet-agent
    helm.sh/chart: gardener-extension-shoot-fleet-agent
    app.kubernetes.io/instance: {{ .Release.Name }}
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: gardener-extension-shoot-fleet-agent
subjects:
- kind: ServiceAccount
  name: gardener-extension-shoot-fleet-agent
  namespace: {{ .Release.Namespace }}
