apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: druid-cluster
rules:
  - apiGroups:
    - ""
    resources:
    - pods
    - configmaps
    - jobs
    - services
    - persistentvolumeclaims
    - pods/log
    - pods/status
    - resourcequotas/status
    - resourcequotas
    verbs:
      - list
      - watch
      - create
      - update
      - delete
      - patch
      - get
  - apiGroups:
      - ""
    resources:
      - events
    verbs:
      - create
      - patch
  - apiGroups:
      - apps
      - batch
    resources:
      - statefulsets
      - deployments
      - pods
      - jobs
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - delete
  - apiGroups:
      - autoscaling
    resources:
      - horizontalpodautoscalers
    verbs:
      - list
      - watch
      - create
      - update
      - patch
  - apiGroups:
      - policy
    resources:
      - poddisruptionbudgets
    verbs:
      - list
      - watch
      - create
      - update
  - apiGroups:
      - networking.k8s.io
    resources:
      - ingresses
    verbs:
      - list
      - watch
      - create
      - update
  - apiGroups:
      - druid.apache.org
    resources:
      - druids
    verbs:
      - get
      - list
      - watch
      - create
      - update
      - patch
      - delete
  - apiGroups:
      - druid.apache.org
    resources:
      - druids/status
    verbs:
      - get
      - update
      - patch
  - apiGroups: 
      - coordination.k8s.io
    resources: 
        - leases
    verbs: 
       - get
       - list 
       - watch
       - create 
       - update
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
  name: druid-cluster
subjects:
- kind: ServiceAccount
  name: default
roleRef:
  kind: Role
  name: druid-cluster
  apiGroup: rbac.authorization.k8s.io