homek8s/apps/base/forgejo/kustomization.yaml
Sirius DevOps 989a0997fb feat(ci-runners): run the deploy runner in a Kata microVM (staged)
The CI capsule cannot enforce PSA baseline: every nested dockerd needs
SYS_ADMIN+NET_ADMIN in the pod spec and baseline forbids exactly those, which
sysbox, gVisor and Kata all reproduce (measured on both arches, card
t_8aa4af50). What a runtime CAN change is what privileged:true means.

Stage 1, one runner: forgejo-runner-deploy-arm64 (rpi) gets
runtimeClassName: kata-qemu, so its privileged dind and job containers run
inside a QEMU/KVM microVM instead of on rpi's host namespaces. The amd64 and
shared arm64 runners stay on privileged dind under runc, untouched.

Kata-specific plumbing in the same Deployment:
- loop-backed ext4 data-root (16GiB image on the existing claim) because
  overlayfs refuses virtiofs and Docker would silently fall back to vfs;
- binfmt_misc + tonistiigi/binfmt --install amd64 on every start, because the
  guest kernel has no qemu handlers and deploy-site.yml cross-builds amd64;
- the runner waits for /var/run/dind-ready (touched after both are set up).

RuntimeClass kata-qemu is cluster-scoped; the containerd handler lives on rpi
only (/etc/containerd/conf.d/50-kata.toml, kata-static 4.4.0). Rollback is one
field. docs/pod-security.md records the measurement and states plainly that the
namespace stays enforce: privileged.
2026-11-27 02:08:47 -05:00

44 lines
1.9 KiB
YAML

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
# Two namespaces: `forgejo` (enforce: baseline) and `ci-runners`
# (enforce: privileged — the CI capsule). Namespace objects sort first.
- namespace.yaml
- ci-runners-namespace.yaml
- httproute.yaml
- pvc.yaml
- cluster.yaml
- podmonitor.yaml
- pg-actions-queries.yaml
# Site-root custom assets (robots.txt) mounted into the forgejo pod.
- custom-public.yaml
- deployment.yaml
- service.yaml
- runner-configmap.yaml
# The runner PVCs/Deployments below and the prune CronJob — plus the two
# runner-token Secrets near the bottom — live in namespace `ci-runners`,
# not `forgejo`: the dind sidecars need `privileged` and the prune Job needs a
# hostPath socket, both of which `forgejo` now rejects at admission
# (enforce: baseline).
#
# Static PVs/PVCs pinned to rpi: dynamic local-path cannot provision there
# (its helper pod is hardcoded to siriussec). Must sort before the runner
# Deployments that consume the claims.
- runner-dind-storage.yaml
# Cluster-scoped RuntimeClass for the Kata microVM that the rpi deploy runner
# uses (card t_8aa4af50). Its handler exists in containerd on rpi only.
- kata-runtimeclass.yaml
- runner-arm64.yaml
- runner-amd64.yaml
- runner-deploy-arm64.yaml
- prune-cronjob.yaml
# Nightly disaster-recovery backup of forgejo-data + every CNPG database to
# the Linode VPS. Lives here because a PVC cannot be mounted cross-namespace.
- cluster-backup.yaml
# Secrets, SOPS/age-encrypted in git. Flux decrypts them (the `apps`
# Kustomization carries a decryption block; key = flux-system/sops-age).
# Never add a plaintext Secret next to these — see docs/secrets-sops.md.
- secret-forgejo-pg-app.sops.yaml
- secret-forgejo-runner-amd64-token.sops.yaml
- secret-forgejo-runner-deploy-arm64-token.sops.yaml
- secret-cluster-backup-ssh.sops.yaml