Running CI in a runner pod that can't reach the cluster API
A NetworkPolicy and no service-account token. Runs #2, #3 and #11 ran on it.
I wanted CI for my repos without giving the CI runner any power over the cluster it runs in.
The Gitea Actions runner runs as a pod on the Dell cluster with:
- no service-account token mounted, so no Kubernetes API access
- not privileged, no privilege escalation, and no Docker-in-Docker
- a NetworkPolicy that blocks all inbound traffic, and allows outbound only to DNS, to Gitea’s HTTP and SSH ports, and to the public internet. Private ranges and Tailscale addresses are blocked.
I checked from inside the pod. The token folder doesn’t exist. Gitea and github.com answer. The cluster API, the Proxmox UI, Infisical, the NAS and a Tailscale address were all blocked.
Infisical and Gitea share an address, and the policy allows only Gitea’s ports, so the runner can’t reach Infisical.
Three traps on the way: Gitea only reads .gitea/workflows or .github/workflows, not .forgejo/workflows. My mirror-check script had the old Forgejo host hard-coded in a policy file. And Gitea’s run API uses head_sha and started_at where Forgejo uses commit_sha and created.
Run #2 failed, correctly: none of the 14 migrated repos had a GitHub push mirror on Gitea yet. Run #3 validated all manifests and passed. Run #11, after the mirror cutover, passed.
Recipes written later from this work: