apiVersion: v1
kind: ServiceAccount
metadata:
  name: zombie-cleanup
  namespace: arc-runners
  labels:
    app.kubernetes.io/name: zombie-cleanup
    app.kubernetes.io/part-of: osdc-zombie-cleanup
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: zombie-cleanup
  namespace: arc-runners
  labels:
    app.kubernetes.io/name: zombie-cleanup
    app.kubernetes.io/part-of: osdc-zombie-cleanup
rules:
  - apiGroups: [""]
    resources: ["pods"]
    verbs: ["get", "list", "delete"]
  - apiGroups: ["actions.github.com"]
    resources: ["ephemeralrunners"]
    verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: zombie-cleanup
  namespace: arc-runners
  labels:
    app.kubernetes.io/name: zombie-cleanup
    app.kubernetes.io/part-of: osdc-zombie-cleanup
subjects:
  - kind: ServiceAccount
    name: zombie-cleanup
    namespace: arc-runners
roleRef:
  kind: Role
  name: zombie-cleanup
  apiGroup: rbac.authorization.k8s.io
