-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-deploying gitea; adding Runner test code
- Loading branch information
1 parent
939d88a
commit 9c90d86
Showing
6 changed files
with
109 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: gitea-runner | ||
namespace: git | ||
labels: | ||
gitea-runner: '' | ||
spec: | ||
serviceAccountName: grt | ||
restartPolicy: OnFailure | ||
initContainers: | ||
- name: fetch-runner-token | ||
image: init-container-image | ||
command: ["ash", "-c"] | ||
args: | ||
- | | ||
apk add --no-cache curl 2>&1 >/dev/null | ||
export ARCH=$(uname -m | awk '{print ($1=="x86_64" ? "amd64" : ($1=="aarch64" ? "arm64" : "unknown"))}') | ||
curl -sLO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl" 2>&1 >/dev/null | ||
chmod +x ./kubectl 2>&1 >/dev/null | ||
./kubectl exec -n git deployments/gitea -c gitea -- gitea actions grt > /token/GITEA_RUNNER_REGISTRATION_TOKEN | ||
echo "Registration Token: $(cat /token/GITEA_RUNNER_REGISTRATION_TOKEN)" | ||
resources: {} | ||
volumeMounts: | ||
- name: token | ||
mountPath: /token | ||
containers: | ||
- name: runner | ||
image: runner-image | ||
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; /sbin/tini -- /opt/act/run.sh"] | ||
env: | ||
- name: DOCKER_HOST | ||
value: tcp://localhost:2376 | ||
- name: DOCKER_CERT_PATH | ||
value: /certs/client | ||
- name: DOCKER_TLS_VERIFY | ||
value: "1" | ||
- name: GITEA_INSTANCE_URL | ||
value: http://gitea-http.git.svc.cluster.local:3000 | ||
- name: GITEA_RUNNER_REGISTRATION_TOKEN_FILE | ||
value: /token/GITEA_RUNNER_REGISTRATION_TOKEN | ||
resources: {} | ||
volumeMounts: | ||
- name: token | ||
mountPath: /token | ||
- name: docker-certs | ||
mountPath: /certs | ||
- name: runner-data | ||
mountPath: /data | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
imagePullPolicy: Always | ||
- name: daemon | ||
image: docker-daemon-image | ||
resources: {} | ||
env: | ||
- name: DOCKER_TLS_CERTDIR | ||
value: /certs | ||
securityContext: | ||
privileged: true | ||
volumeMounts: | ||
- name: docker-certs | ||
mountPath: /certs | ||
terminationMessagePath: /dev/termination-log | ||
terminationMessagePolicy: File | ||
imagePullPolicy: IfNotPresent | ||
volumes: | ||
- name: docker-certs | ||
emptyDir: {} | ||
- name: runner-data | ||
persistentVolumeClaim: | ||
claimName: act-runner-vol | ||
- name: token | ||
emptyDir: {} | ||
terminationGracePeriodSeconds: 30 | ||
securityContext: {} | ||
tolerations: | ||
- key: node.kubernetes.io/not-ready | ||
operator: Exists | ||
effect: NoExecute | ||
tolerationSeconds: 300 | ||
- key: node.kubernetes.io/unreachable | ||
operator: Exists | ||
effect: NoExecute | ||
tolerationSeconds: 300 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters