---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: drone
  labels:
    app: drone
rules:
- apiGroups: [""]
  resources:
  - configmaps
  - namespaces
  - pods
  - secrets
  verbs:
  - create
  - get
  - list
  - delete
  - watch
- apiGroups: [""]
  resources:
  - pods/log
  verbs:
  - get
- apiGroups: ["batch"]
  resources:
  - jobs
  verbs:
  - create
  - get
  - list
  - watch
  - update
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: drone
  labels:
    app: drone
subjects:
- kind: ServiceAccount
  name: default
  namespace: drone
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: drone
