feat(ci): add GC CronJob for runner cleanup, expand reg PVCs to 20Gi

- Add gc-cronjob.yaml: daily prune of DinD Docker images/volumes/build-cache
  and actcache across all forgejo-runner pods. Keeps :latest tagged images,
  deletes non-latest older than 72h.
- Expand runner reg PVCs from 1Gi to 20Gi (all three runners) to prevent
  action tool cache from filling disk.
- Rust runner gets explicit 20Gi persistence override.
- GC only renders from golang (default) values to avoid duplicate resources.
This commit is contained in:
2026-08-30 07:08:59 -07:00
parent bde6c740ec
commit 91729f65e9
4 changed files with 171 additions and 1 deletions
+12 -1
View File
@@ -39,7 +39,7 @@ dind:
persistence:
reg:
storageClass: longhorn # Unified StorageClass (3 replicas)
size: 1Gi # .runner registration file + config — survives pod restarts
size: 20Gi # .runner registration file + action tool cache + actcache artifacts
dind:
storageClass: longhorn # Unified StorageClass (3 replicas)
size: 30Gi # docker layer cache — keeps rebuilds fast across restarts
@@ -53,3 +53,14 @@ tolerations:
# attach there.
nodeSelector:
topology.kubernetes.io/zone: az-a
# GC CronJob — prunes Docker images/volumes/build-cache and actcache across
# ALL forgejo-runner pods. Only enable in default values (golang instance);
# disable in per-runner overrides so it renders once.
gc:
enabled: true
schedule: "0 3 * * *" # daily 03:00 UTC
image: alpine/k8s:1.31.0
pruneAge: "72h" # Docker artifacts unused longer than this get pruned
pruneAgeHours: 72 # Same as pruneAge but numeric for date arithmetic in shell
actcacheMaxAgeDays: 3 # actcache files older than N days get deleted