apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: dynatrace-webhook
  namespace: dynatrace
  labels:
    dynatrace.com/operator: dynakube
    internal.dynatrace.com/component: webhook
rules:
  - apiGroups:
      - ""
    resources:
      - services
      - configmaps
      - secrets
    verbs:
      - get
      - list
      - watch
      - create
      - update
  - apiGroups:
      - ""
    resources:
      - pods
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - dynatrace.com
    resources:
      - dynakubes
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - list
      - create
  - apiGroups:
      - coordination.k8s.io
    resources:
      - leases
    verbs:
      - get
      - update
      - create
  - apiGroups:
      - apps
    resources:
      - daemonsets
    verbs:
      - list
      - watch

