# SPDX-FileCopyrightText: 2021 SAP SE or an SAP affiliate company and Gardener contributors
#
# SPDX-License-Identifier: Apache-2.0

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: gardener-extension-shoot-networking-filter
  labels:
    app.kubernetes.io/name: gardener-extension-shoot-networking-filter
rules:
  - apiGroups:
      - extensions.gardener.cloud
    resources:
      - clusters
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - extensions.gardener.cloud
    resources:
      - dnsrecords
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - resources.gardener.cloud
    resources:
      - managedresources
    verbs:
      - "*"
  - apiGroups:
      - ""
    resources:
      - namespaces
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - extensions.gardener.cloud
    resources:
      - extensions
      - extensions/status
    verbs:
      - get
      - list
      - watch
      - patch
      - update
  - apiGroups:
      - ""
    resources:
      - configmaps
      - secrets
      - events
    verbs:
      - "*"
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    verbs:
      - create
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    resourceNames:
      - extension-shoot-networking-filter-leader-election
    verbs:
      - update
      - get
      - watch
