apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  labels:
    {{- include "etcd-operator.labels" . | nindent 4 }}
  name: {{ include "etcd-operator.fullname" . }}-manager-role
rules:
  - apiGroups:
      - ""
    resources:
      - configmaps
    verbs:
      - create
      - delete
      - get
      - list
      - patch
      - update
      - watch
  - apiGroups:
      - ""
    resources:
      - endpoints
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - secrets
    verbs:
      - list
      - get
      - watch
  - apiGroups:
      - ""
    resources:
      - services
    verbs:
      - create
      - delete
      - get
      - list
      - patch
      - update
      - watch
  - apiGroups:
      - apps
    resources:
      - statefulsets
    verbs:
      - create
      - delete
      - get
      - list
      - patch
      - update
      - watch
  - apiGroups:
    - ""
    resources:
    - persistentvolumeclaims
    verbs:
    - get
    - list
    - patch
    - watch
  - apiGroups:
    - "storage.k8s.io"
    resources:
    - storageclasses
    verbs:
    - get
    - list
    - watch
  - apiGroups:
      - etcd.aenix.io
    resources:
      - etcdclusters
    verbs:
      - create
      - delete
      - get
      - list
      - patch
      - update
      - watch
  - apiGroups:
      - etcd.aenix.io
    resources:
      - etcdclusters/finalizers
    verbs:
      - update
  - apiGroups:
      - etcd.aenix.io
    resources:
      - etcdclusters/status
    verbs:
      - get
      - patch
      - update
  - apiGroups:
    - policy
    resources:
    - poddisruptionbudgets
    verbs:
    - create
    - delete
    - get
    - list
    - patch
    - update
    - watch
