gitea runner improvements

This commit is contained in:
Remy Moll 2024-05-13 14:21:56 +02:00
parent 1a9d0fc00c
commit 0fd9936db5
3 changed files with 48 additions and 0 deletions

View File

@ -12,6 +12,7 @@ spec:
app: actions-runner
spec:
hostname: kube-runner
serviceAccountName: actions-runner
containers:
- name: actions-runner
image: actions-runner
@ -29,3 +30,10 @@ spec:
key: runner-token
- name: GITEA_RUNNER_LABELS
value: k8s
volumeMounts:
- name: runner-data
mountPath: /data
volumes:
- name: runner-data
emptyDir: {}

View File

@ -0,0 +1,38 @@
apiVersion: v1
kind: ServiceAccount
metadata:
name: actions-runner
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: actions-role
rules:
- apiGroups: [""]
resources: ["pods"]
verbs: ["get", "list", "create", "delete"]
- apiGroups: [""]
resources: ["pods/exec"]
verbs: ["get", "create"]
- apiGroups: [""]
resources: ["pods/log"]
verbs: ["get", "list", "watch",]
- apiGroups: ["batch"]
resources: ["jobs"]
verbs: ["get", "list", "create", "delete"]
- apiGroups: [""]
resources: ["secrets"]
verbs: ["get", "list", "create", "delete"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: actions-role-binding
subjects:
- kind: ServiceAccount
name: actions-runner
apiGroup: ""
roleRef:
kind: Role
name: actions-role
apiGroup: rbac.authorization.k8s.io

View File

@ -10,6 +10,8 @@ resources:
- drone-server.sealedsecret.yaml
- actions.deployment.yaml
- actions.sealedsecret.yaml
- actions.rbac.yaml
namespace: gitea