apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: host-upgrades
rules:
# locking
- apiGroups:
  - apps
  resources:
  - daemonsets
  verbs:
  - get
  - watch
- apiGroups:
  - apps
  resources:
  - daemonsets
  resourceNames:
  - host-upgrades
  verbs:
  - update
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - get
- apiGroups:
  - ""
  resources:
  - nodes/status
  verbs:
  - update

# drain
- apiGroups:
  - ""
  resources:
  - nodes
  verbs:
  - update
  - patch
- apiGroups:
  - ""
  resources:
  - pods
  verbs:
  - list
  - get
  - delete
- apiGroups:
  - extensions
  resources:
  - daemonsets
  verbs:
  - get
- apiGroups:
  - ""
  resources:
  - pods/eviction
  verbs:
  - create
