apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: dynatrace-oneagent-operator
  namespace: dynatrace
  labels:
    dynatrace: operator
    operator: oneagent
rules:
  - apiGroups:
      - dynatrace.com
    resources:
      - oneagents
    verbs:
      - get
      - list
      - watch
      - update
  - apiGroups:
      - apps
    resources:
      - daemonsets
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - delete
  - apiGroups:
      - "" # "" indicates the core API group
    resources:
      - configmaps
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - delete
  - apiGroups:
      - "" # "" indicates the core API group
    resources:
      - pods
    verbs:
      - get
      - list
      - watch
      - delete
  - apiGroups:
      - apps
    resources:
      - replicasets
      - deployments
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - apps
    resources:
      - deployments/finalizers
    verbs:
      - update
  - apiGroups:
      - "" # "" indicates the core API group
    resources:
      - secrets
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - monitoring.coreos.com
    resources:
      - servicemonitors
    verbs:
      - get
      - create
  - apiGroups:
      - dynatrace.com
    resources:
      - oneagents/finalizers
      - oneagents/status
    verbs:
      - update
  - apiGroups:
      - networking.istio.io
    resources:
      - serviceentries
      - virtualservices
    verbs:
      - get
      - list
      - create
      - update
      - delete
