# Cluster role for the operator itself.
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: openshift-externaldns-operator
rules:
- apiGroups:
  - operator.openshift.io
  resources:
  - externaldnses
  verbs:
  - "*"

- apiGroups:
  - operator.openshift.io
  resources:
  - externaldnses/status
  verbs:
  - update

- apiGroups:
    - config.openshift.io
  resources:
    - infrastructures
    - ingresses
    - dnses
  verbs:
    - get

- apiGroups:
  - apps
  resources:
  - deployments
  verbs:
  - "*"

- apiGroups:
  - ""
  resources:
  - namespaces
  - serviceaccounts
  verbs:
  - create
  - get
  - list
  - watch
  - delete

- apiGroups:
    - ""
  resources:
    - secrets
  verbs:
    - get

- apiGroups:
  - rbac.authorization.k8s.io
  resources:
  - clusterroles
  - clusterrolebindings
  verbs:
  - create
  - get
  - list
  - watch

- apiGroups:
  - config.openshift.io
  resources:
  - clusteroperators
  verbs:
  - create
  - get

- apiGroups:
  - config.openshift.io
  resources:
  - clusteroperators/status
  verbs:
  - update

# Mirrored from assets/external-dns/cluster-role.yaml
- apiGroups: [""]
  resources: ["services"]
  verbs: ["get","watch","list"]
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get","watch","list"]
- apiGroups: ["extensions"]
  resources: ["ingresses"]
  verbs: ["get","watch","list"]
- apiGroups: [""]
  resources: ["nodes"]
  verbs: ["list"]
