fix(forgejo-runner): add init container to fix cache permissions
This commit is contained in:
parent
e6f55840e2
commit
9423d5fd6d
2 changed files with 13 additions and 3 deletions
kubernetes/main/apps/dev/forgejo-runner/app
|
@ -59,7 +59,7 @@ data:
|
|||
enabled: true
|
||||
# The directory to store the cache data.
|
||||
# If it's empty, the cache data will be stored in $HOME/.cache/actcache.
|
||||
dir: "/cache"
|
||||
dir: ""
|
||||
# The host of the cache server.
|
||||
# It's not for the address to listen, but the address to connect from job containers.
|
||||
# So 0.0.0.0 is a bad choice, leave it empty to detect automatically.
|
||||
|
|
|
@ -50,10 +50,20 @@ spec:
|
|||
volumeMounts:
|
||||
- name: runner-data
|
||||
mountPath: /data
|
||||
# fix permissions of cache pvc
|
||||
- command: ["sh", "-c", "chown -R 1000:1000 /data/.cache"]
|
||||
image: busybox
|
||||
volumeMounts:
|
||||
- mountPath: /data/.cache/actcache
|
||||
name: forgejo-runner-cache
|
||||
name: fix-permissions
|
||||
containers:
|
||||
- name: runner
|
||||
image: *runnerImg
|
||||
command: ["sh", "-c", "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; forgejo-runner daemon --config /data/config.yml"]
|
||||
command:
|
||||
- "sh"
|
||||
- "-c"
|
||||
- "while ! nc -z localhost 2376 </dev/null; do echo 'waiting for docker daemon...'; sleep 5; done; forgejo-runner daemon --config /data/config.yml"
|
||||
env:
|
||||
- name: DOCKER_HOST
|
||||
value: tcp://localhost:2376
|
||||
|
@ -70,7 +80,7 @@ spec:
|
|||
mountPath: /data/config.yml
|
||||
subPath: config.yml
|
||||
- name: forgejo-runner-cache
|
||||
mountPath: /cache
|
||||
mountPath: /data/.cache/actcache
|
||||
- name: daemon
|
||||
image: docker:27.4.1-dind
|
||||
env:
|
||||
|
|
Loading…
Add table
Reference in a new issue