# services/comms/synapse-signingkey-ensure-rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: othrys-synapse-signingkey-job
  namespace: comms
imagePullSecrets:
  - name: harbor-regcred
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: othrys-synapse-signingkey-job
  namespace: comms
rules:
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["create"]
  - apiGroups: [""]
    resources: ["secrets"]
    resourceNames: ["othrys-synapse-signingkey"]
    verbs: ["get", "patch", "update"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: othrys-synapse-signingkey-job
  namespace: comms
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: othrys-synapse-signingkey-job
subjects:
  - kind: ServiceAccount
    name: othrys-synapse-signingkey-job
    namespace: comms
