apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: postgresql-operator
rules:
- apiGroups:
  - '*'
  resources:
  - '*'
  verbs:
  - get
  - list
- apiGroups:
  - ""
  resources:
  - pods/exec
  verbs:
  - create
- apiGroups:
  - ""
  resources:
  - deployments
  - daemonsets
  - replicasets
  - statefulsets
  - serviceaccounts
  - rolebindings
  - pods
  - services
  - service/finalizers
  - endpoints
  - persistentvolumeclaims
  - events
  - configmaps
  - secrets
  verbs:
  - '*'
- apiGroups:
  - batch
  resources:
  - cronjobs
  verbs:
  - get
  - list
  - watch
  - create
  - update
  - patch
  - delete
- apiGroups:
  - apps
  resources:
  - deployments
  - daemonsets
  - replicasets
  - statefulsets
  verbs:
  - '*'
- apiGroups:
  - monitoring.coreos.com
  resources:
  - servicemonitors
  verbs:
  - get
  - create
- apiGroups:
  - apps
  resourceNames:
  - postgresql-operator
  - postgresql
  - backup
  resources:
  - deployments/finalizers
  verbs:
  - update
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - get
- apiGroups:
  - apps
  resources:
  - replicasets
  verbs:
  - get
- apiGroups:
  - postgresql-operator.dev4devs.com
  resources:
  - '*'
  - backups
  verbs:
  - '*'
- apiGroups:
  - postgresql.dev4devs.com
  resources:
  - '*'
  - backups
  - databases
  verbs:
  - '*'
