REFACTOR(gitea): remove gitea-runner
This commit is contained in:
@@ -1,98 +0,0 @@
|
|||||||
apiVersion: v1
|
|
||||||
kind: ConfigMap
|
|
||||||
metadata:
|
|
||||||
name: gitea-runner-config
|
|
||||||
namespace: gitea
|
|
||||||
data:
|
|
||||||
config.yaml: |
|
|
||||||
log:
|
|
||||||
level: info
|
|
||||||
runner:
|
|
||||||
name: k8s-runner
|
|
||||||
capacity: 10
|
|
||||||
timeout: 3h
|
|
||||||
insecure: false
|
|
||||||
fetch_timeout: 5s
|
|
||||||
fetch_interval: 2s
|
|
||||||
labels:
|
|
||||||
- "ubuntu-latest:docker://catthehacker/ubuntu:act-latest"
|
|
||||||
- "ubuntu-24.04:docker://catthehacker/ubuntu:act-latest"
|
|
||||||
- "ubuntu-24.04-arm:docker://catthehacker/ubuntu:act-latest"
|
|
||||||
container:
|
|
||||||
network: host
|
|
||||||
options: -e DOCKER_HOST=tcp://localhost:2375
|
|
||||||
---
|
|
||||||
apiVersion: apps/v1
|
|
||||||
kind: Deployment
|
|
||||||
metadata:
|
|
||||||
name: gitea-runner
|
|
||||||
namespace: gitea
|
|
||||||
labels:
|
|
||||||
app: gitea-runner
|
|
||||||
spec:
|
|
||||||
replicas: 1
|
|
||||||
selector:
|
|
||||||
matchLabels:
|
|
||||||
app: gitea-runner
|
|
||||||
template:
|
|
||||||
metadata:
|
|
||||||
labels:
|
|
||||||
app: gitea-runner
|
|
||||||
spec:
|
|
||||||
restartPolicy: Always
|
|
||||||
volumes:
|
|
||||||
- name: docker-certs
|
|
||||||
emptyDir: {}
|
|
||||||
- name: runner-data
|
|
||||||
emptyDir: {}
|
|
||||||
- name: config
|
|
||||||
configMap:
|
|
||||||
name: gitea-runner-config
|
|
||||||
containers:
|
|
||||||
# Docker daemon (Docker-in-Docker)
|
|
||||||
- name: docker-daemon
|
|
||||||
image: docker:dind
|
|
||||||
env:
|
|
||||||
- name: DOCKER_TLS_CERTDIR
|
|
||||||
value: ""
|
|
||||||
securityContext:
|
|
||||||
privileged: true
|
|
||||||
volumeMounts:
|
|
||||||
- name: docker-certs
|
|
||||||
mountPath: /certs
|
|
||||||
|
|
||||||
# Gitea Actions runner
|
|
||||||
- name: runner
|
|
||||||
image: gitea/act_runner:latest
|
|
||||||
command:
|
|
||||||
- sh
|
|
||||||
- -c
|
|
||||||
- |
|
|
||||||
while ! nc -z localhost 2375 </dev/null; do
|
|
||||||
echo 'waiting for docker daemon...';
|
|
||||||
sleep 1;
|
|
||||||
done
|
|
||||||
act_runner register --no-interactive --instance "$GITEA_INSTANCE_URL" --token "$GITEA_RUNNER_REGISTRATION_TOKEN" --name k8s-runner --labels "ubuntu-latest:docker://catthehacker/ubuntu:act-latest,ubuntu-24.04:docker://catthehacker/ubuntu:act-latest,ubuntu-24.04-arm:docker://catthehacker/ubuntu:act-latest"
|
|
||||||
act_runner daemon
|
|
||||||
env:
|
|
||||||
- name: DOCKER_HOST
|
|
||||||
value: tcp://localhost:2375
|
|
||||||
- name: GITEA_INSTANCE_URL
|
|
||||||
value: "http://gitea-http.gitea.svc.cluster.local:3000"
|
|
||||||
- name: GITEA_RUNNER_REGISTRATION_TOKEN
|
|
||||||
valueFrom:
|
|
||||||
secretKeyRef:
|
|
||||||
name: gitea-runner-token
|
|
||||||
key: token
|
|
||||||
volumeMounts:
|
|
||||||
- name: docker-certs
|
|
||||||
mountPath: /certs
|
|
||||||
- name: runner-data
|
|
||||||
mountPath: /data
|
|
||||||
- name: config
|
|
||||||
mountPath: /config.yaml
|
|
||||||
subPath: config.yaml
|
|
||||||
resources:
|
|
||||||
requests:
|
|
||||||
cpu: 50m
|
|
||||||
memory: 128Mi
|
|
||||||
@@ -1,10 +1,8 @@
|
|||||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- deployment.yaml
|
|
||||||
- vault/gitea-admin-secret.yaml
|
- vault/gitea-admin-secret.yaml
|
||||||
- vault/gitea-postgres-password.yaml
|
- vault/gitea-postgres-password.yaml
|
||||||
- vault/gitea-runner-token.yaml
|
|
||||||
- vault/gitea-minio-credentials.yaml
|
- vault/gitea-minio-credentials.yaml
|
||||||
- vault/minio-root-password.yaml
|
- vault/minio-root-password.yaml
|
||||||
namespace: gitea
|
namespace: gitea
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
apiVersion: external-secrets.io/v1
|
|
||||||
kind: ExternalSecret
|
|
||||||
metadata:
|
|
||||||
name: gitea-runner-token
|
|
||||||
namespace: gitea
|
|
||||||
spec:
|
|
||||||
refreshInterval: 1h
|
|
||||||
secretStoreRef:
|
|
||||||
kind: ClusterSecretStore
|
|
||||||
name: vault-backend
|
|
||||||
target:
|
|
||||||
name: gitea-runner-token
|
|
||||||
creationPolicy: Owner
|
|
||||||
data:
|
|
||||||
- secretKey: token
|
|
||||||
remoteRef:
|
|
||||||
key: gitea/runner
|
|
||||||
property: TOKEN
|
|
||||||
Reference in New Issue
Block a user