# Needed to spawn Dask cluster
# from https://kubernetes.dask.org/en/latest/kubecluster.html?highlight=rbac#role-based-access-control-rbac
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: daskkubernetes
rules:
  - apiGroups:
      - ""  # indicates the core API group
    resources:
      - "pods"
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "delete"
  - apiGroups:
      - ""  # indicates the core API group
    resources:
      - "pods/log"
    verbs:
      - "get"
      - "list"
  - apiGroups:
      - "" # indicates the core API group
    resources:
      - "services"
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "delete"
  - apiGroups:
      - "policy"  # indicates the policy API group
    resources:
      - "poddisruptionbudgets"
    verbs:
      - "get"
      - "list"
      - "watch"
      - "create"
      - "delete"
