apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: manager-role
rules:
##
## Base operator rules
##
# We need to get namespaces so the operator can read namespaces to ensure they exist
- apiGroups:
  - ""
  resources:
  - namespaces
  verbs:
  - get
# We need to manage Helm release secrets
- apiGroups:
  - ""
  resources:
  - secrets
  verbs:
  - "*"
# We need to create events on CRs about things happening during reconciliation
- apiGroups:
  - ""
  resources:
  - events
  verbs:
  - create

##
## Rules for spire.spiffe.io/v1alpha1, Kind: Spire
##
- apiGroups:
  - spire.spiffe.io
  resources:
  - spires
  - spires/status
  - spires/finalizers
  verbs:
  - create
  - delete
  - get
  - list
  - patch
  - update
  - watch
- verbs:
  - "*"
  apiGroups:
  - "rbac.authorization.k8s.io"
  resources:
  - "clusterrolebindings"
  - "clusterroles"
- verbs:
  - "*"
  apiGroups:
  - ""
  resources:
  - "configmaps"
  - "serviceaccounts"
  - "services"
- verbs:
  - "*"
  apiGroups:
  - "apps"
  resources:
  - "daemonsets"
  - "statefulsets"

#+kubebuilder:scaffold:rules
