apiVersion: v1
kind: ServiceAccount
metadata:
  name: gitea-runner-sa
  namespace: geocrop
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: gitea-runner-role
  namespace: geocrop
rules:
  - apiGroups: [""]
    resources: ["pods", "pods/log", "pods/exec"]
    verbs: ["get", "list", "watch", "create", "delete"]
  - apiGroups: [""]
    resources: ["secrets"]
    verbs: ["get", "list", "create", "delete"]
  - apiGroups: [""]
    resources: ["configmaps"]
    verbs: ["get", "list", "create", "delete"]
  - apiGroups: ["batch"]
    resources: ["jobs"]
    verbs: ["get", "list", "create", "delete"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: gitea-runner-rolebinding
  namespace: geocrop
subjects:
  - kind: ServiceAccount
    name: gitea-runner-sa
    namespace: geocrop
roleRef:
  kind: Role
  name: gitea-runner-role
  apiGroup: rbac.authorization.k8s.io
