apiVersion: v1
kind: ServiceAccount
metadata:
  name: pdb-controller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: pdb-controller
rules:
- apiGroups: ["apps"]
  resources: ["deployments", "statefulsets"]
  verbs: ["get", "list"]
- apiGroups: ["policy"]
  resources: ["poddisruptionbudgets"]
  verbs: ["get", "list", "create", "delete"]
- apiGroups: [""]
  resources: ["namespaces", "pods"]
  verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: pdb-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: pdb-controller
subjects:
- kind: ServiceAccount
  name: pdb-controller
  namespace: kube-system

apiVersion: v1
kind: ServiceAccount
metadata:
  name: pdb-controller
  namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: pdb-controller
rules:
- apiGroups: ["apps"]
  resources: ["deployments", "statefulsets"]
  verbs: ["get", "list"]
- apiGroups: ["policy"]
  resources: ["poddisruptionbudgets"]
  verbs: ["get", "list", "create", "delete", "update"]
- apiGroups: [""]
  resources: ["namespaces", "pods"]
  verbs: ["get", "list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: pdb-controller
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: pdb-controller
subjects:
- kind: ServiceAccount
  name: pdb-controller
  namespace: kube-system

Allow pdb-controller to update PDBs
Allow pdb-controller to update PDBs

Signed-off-by: Mikkel Oscar Lyderik Larsen <81479e3d2d1e6902cb05f938ea9a734a092b1af3@zalando.de>
