apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  # "namespace" omitted since ClusterRoles are not namespaced
  name: ezbackup-scaler-role
rules:
- apiGroups: [""]
  resources: ["pods"]
  verbs: ["get", "watch", "list", "delete"]
- apiGroups: ["extensions", "apps"]
  resources: [
    "deployments", "deployments/scale",
    "replicasets", "replicasets/scale",
    "daemonsets", "daemonsets/scale",
    "statefulsets", "statefulsets/scale"
  ]
  verbs: ["get", "update"]
- apiGroups: ["batch", "extensions"]
  resources: ["jobs", "cronjobs"]
  verbs: ["get", "delete"]