apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "chart.resourceNamePrefix" . }}hub
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: {{ include "chart.resourceNamePrefix" . }}job-reader
rules:
  - apiGroups: ["batch"]
    resources: ["jobs"]
    verbs: ["get", "list"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: {{ include "chart.resourceNamePrefix" . }}hub-job-reader
subjects:
  - kind: ServiceAccount
    name: {{ include "chart.resourceNamePrefix" . }}hub
roleRef:
  kind: Role
  name: {{ include "chart.resourceNamePrefix" . }}job-reader
  apiGroup: rbac.authorization.k8s.io
