apiVersion: v1 kind: Namespace metadata: name: forgejo-runners # The Forgejo Actions CI capsule: three runner Deployments (each with a # privileged docker-in-docker sidecar), their data PVCs, and the nightly # prune CronJob (hostPath `/var/run/docker.sock`). # # `enforce: privileged` is deliberate and is the whole point of this # namespace existing. Pod Security has no per-workload exception: if these # pods share `forgejo`, that namespace can only ever be warn/audit, i.e. no # namespace in the cluster enforces anything. Isolating the capsule here lets # `forgejo` enforce `baseline` (Forgejo, Postgres, backups) while this # namespace keeps the one shape that genuinely needs node root and is # labelled as such in Git. # # This is containment, not a grant of new privilege: the dind sidecar was # already privileged, and CI job containers are unprivileged # (`container.privileged: false` in the runner ConfigMap). Keep this # namespace free of anything that is not part of the CI capsule, and give it # its own NetworkPolicy/RBAC scope rather than widening it. # # warn/audit at `restricted` still print and record every violation, so a new # privileged/hostPath pod here is visible even though it is admitted. labels: pod-security.kubernetes.io/enforce: privileged pod-security.kubernetes.io/enforce-version: latest pod-security.kubernetes.io/warn: restricted pod-security.kubernetes.io/warn-version: latest pod-security.kubernetes.io/audit: restricted pod-security.kubernetes.io/audit-version: latest