2026-09-11 00:08:31 -04:00
|
|
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
|
|
|
|
kind: Kustomization
|
|
|
|
|
resources:
|
2026-11-27 01:20:56 -05:00
|
|
|
# Two namespaces: `forgejo` (enforce: baseline) and `ci-runners`
|
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
|
|
|
# (enforce: privileged — the CI capsule). Namespace objects sort first.
|
2026-09-11 00:08:31 -04:00
|
|
|
- namespace.yaml
|
2026-11-27 01:20:56 -05:00
|
|
|
- ci-runners-namespace.yaml
|
2026-09-11 00:08:31 -04:00
|
|
|
- httproute.yaml
|
infra(netpol): default-deny ingress+egress for the six app namespaces
Audit F3 / A5-1. Every pod in customer1, osint, sirius-growth, piedmont,
siriusdevops and forgejo was reachable from every other pod, from the API
server, from the internal WireGuard-only Gateway ports on 10.10.0.2 and from
the internet.
- each namespace: a stock NetworkPolicy 'default-deny' (podSelector {},
Ingress+Egress, no rules) plus a CiliumNetworkPolicy allow that names the
gateway/kubelet/health entities, same-namespace pods, cluster DNS and only
the egress each workload actually uses (world for Telegram/news/inference,
remote-node :3900 for Garage, :22 for the backup rsync, kube-apiserver :6443
where CNPG/kubectl needs it, none at all for customer1)
- siriusdevops: replaces the egress-only siriusdevops-site-egress CNP
- customer1: ResourceQuota + LimitRange sized from the declared 1-replica
shape (35Gi already bound, 2 CPU / 4Gi requests) - the sandbox stays parked
- docs/network-isolation.md: the model plus the five gotchas measured while
landing it (both-ends enforcement, kube-apiserver identity covering the
whole node IP, remote-node vs world for Garage, ingress vs host identity)
2026-11-27 02:19:10 -05:00
|
|
|
# Default-deny ingress+egress + the namespace allow list (audit F3 / t_fed52919).
|
|
|
|
|
- networkpolicy.yaml
|
feat(backup): run the three nightly backups from a pinned image with an egress allow list
monitoring/grafana-backup, forgejo/cluster-backup and sirius-growth/leadgen-backup
all ran `apk add --no-cache rsync openssh-client` at container start. Every night
that dialled dl-cdn.alpinelinux.org (Fastly anycast 151.101.x.132:443), which is
what `egress-new-dst` kept reporting, and made the backups depend on the public
internet at 03:00 UTC.
- image: forgejo.siriusdevops.com/sirius/backup-tools, built in CI from
python:3.12-alpine (pinned by digest) + rsync + openssh-client + bash +
kubectl v1.36.4 (release sha256 verified at build). Pinned by digest in all
three CronJobs, no apk in any backup path.
- egress: CiliumNetworkPolicy per backup pod — cluster DNS and 10.10.0.5:22 for
all three, plus kube-apiserver 6443/443 for cluster-backup only, with an
explicit deny for `world` (Cilium unions namespace policies, so the allow list
alone would not restrict a pod inside `forgejo`/`sirius-growth`).
- monitoring gains the registry pull secret it never needed before; the job now
keeps imagePullSecrets: forgejo-pull (SOPS-encrypted in git).
Schedules, retention, destination paths, entrypoints and RBAC are unchanged.
2026-12-04 00:20:34 -05:00
|
|
|
# Egress lockdown for the cluster-backup pod: DNS + 10.10.0.5:22 + the API
|
|
|
|
|
# only. The allow list above cannot be narrowed per pod, so the deny for
|
|
|
|
|
# `world` in this policy is what applies to the job (card t_9d0428d8).
|
|
|
|
|
- networkpolicy-backup.yaml
|
2026-09-11 00:08:31 -04:00
|
|
|
- pvc.yaml
|
|
|
|
|
- cluster.yaml
|
2026-10-27 01:32:20 -04:00
|
|
|
- podmonitor.yaml
|
|
|
|
|
- pg-actions-queries.yaml
|
2026-11-23 22:50:52 -05:00
|
|
|
# Site-root custom assets (robots.txt) mounted into the forgejo pod.
|
|
|
|
|
- custom-public.yaml
|
2026-09-11 00:08:31 -04:00
|
|
|
- deployment.yaml
|
|
|
|
|
- service.yaml
|
2026-09-11 22:24:41 -04:00
|
|
|
- runner-configmap.yaml
|
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
|
|
|
# The runner PVCs/Deployments below and the prune CronJob — plus the two
|
2026-11-27 01:20:56 -05:00
|
|
|
# runner-token Secrets near the bottom — live in namespace `ci-runners`,
|
ci(runners): isolate the CI capsule in forgejo-runners, enforce baseline on forgejo
The three Actions runners (privileged dind sidecars) and the nightly prune
CronJob (hostPath /var/run/docker.sock) cannot live under PSA baseline, so
they move to their own namespace `forgejo-runners` with `enforce: privileged`
(plus warn/audit restricted). That lets `forgejo` — Forgejo, CNPG Postgres,
cluster-backup — enforce `baseline` instead of only warning.
The dind sidecars stay privileged: measured on these nodes, a non-privileged
pod cannot host a container runtime (cgroup fs is mounted ro; rootless dind
cannot mount procfs; procMount=Unmasked needs hostUsers=false where subuid
maps and /dev/net/tun are refused). See docs/pod-security.md.
- PVCs/PVs are reused, not recreated: the two static Retain PVs on rpi and the
dynamic local-path PV on siriussec were rebound by name, so runner.ini
(registration uuid), the dind data-root and the actions cache survive.
- prune CronJob + its SA/Role/RoleBinding/configmap move with the runners;
NAMESPACE and the Role scope follow.
- monitoring: runner/prune queries and runbooks now select forgejo-runners;
cnpg_actions_* panels keep namespace="forgejo" (that is the pg namespace).
- docs: pod-security.md rewritten for the two enforced namespaces.
Verified live: all three runners 2/2 Running in forgejo-runners with their
original registration uuids and image counts, forgejo rejects a privileged pod
at admission, and a real CI image build completes (see the card).
2026-11-27 01:15:07 -05:00
|
|
|
# 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).
|
|
|
|
|
#
|
2026-10-27 02:03:11 -04:00
|
|
|
# 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
|
2026-11-27 02:08:47 -05:00
|
|
|
# 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
|
2026-09-11 22:34:33 -04:00
|
|
|
- runner-arm64.yaml
|
|
|
|
|
- runner-amd64.yaml
|
2026-10-22 23:52:54 -04:00
|
|
|
- runner-deploy-arm64.yaml
|
2026-10-22 23:55:21 -04:00
|
|
|
- prune-cronjob.yaml
|
apps(backup): nightly Forgejo data + CNPG dumps to the Linode, and prove a restore
Nothing on this platform backed up Forgejo or the CloudNativePG databases;
docs/cluster-overview.md had claimed both must be backed up for months.
New CronJob forgejo/cluster-backup (37 2 * * * UTC, Forbid) streams to
[email protected]:/root/cluster-backup over the WireGuard mesh:
* forgejo-data PVC mirrored with rsync --link-dest (snapshot per night,
hardlinked, readonly PVC mount, transient upload spools excluded, rsync
exit 24 tolerated because Forgejo is live while it runs);
* pg_dump -Fc from inside each CNPG primary (local socket, no DB password
in git) for forgejo/pg and sirius-growth/portal, sha256-verified on both
sides before the .part file is renamed.
Nothing is staged on siriussec (83% full, DiskPressure hazard); the job has
an ephemeral-storage cap of 1Gi to make that structural. Job lives in ns
forgejo because a PVC cannot be mounted cross-namespace; the portal dump uses
exec-only RBAC declared in apps/base/sirius-growth/backup-exec-rbac.yaml.
Only secret is forgejo/cluster-backup-ssh (out of band, not in git):
from=-restricted ed25519 key on the Linode, host key pinned.
docs/cluster-overview.md: §8.1 coverage + honest gaps, §8.2 restore runbook,
live PVC/disk numbers corrected.
2026-11-19 17:01:05 -05:00
|
|
|
# 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: bring 29 hand-made cluster Secrets under Git via SOPS/age (audit F12)
Nothing in the cluster was reconciled from the repo: 67 hand-made Secrets and no
managed Secret at all, so a restore of this Git tree produced a cluster that would
not start. This commits the first-party ones as SOPS/age ciphertext and enables
Flux's sops decryptor.
* provider: SOPS + age (chosen over SealedSecrets: Flux already ships the sops
decryptor, so no extra controller/CRD, and the age key is escrowed off-cluster).
* 29 Secrets across forgejo, siriusdevops, piedmont, sirius-growth, osint,
metabase and customer1, as apps/base/<ns>/secret-<name>.sops.yaml with
encrypted_regex ^(data|stringData)$ — names/namespaces stay reviewable.
* each file was generated from the LIVE object and decrypts to a byte-identical
data map and type, so the first apply is a no-op (not a rotation).
* the CNPG bootstrap secrets (forgejo-pg-app, pg-app, sirius-growth-portal-db)
are ours, not operator output — bootstrap.initdb.secret points at them, so a
rebuild has no application password without them.
* forgejo-pull is included despite docs/registry-pull-auth.md calling it
out-of-band: with imagePullSecrets on every workload it is the one Secret whose
absence stops the whole cluster from pulling images.
* .gitignore keeps **/*secret*.yaml ignored and re-includes only .sops.yaml, so a
plaintext Secret still cannot be committed; age.agekey stays ignored.
* excluded on purpose (controller/helm-owned): CNPG *-server/*-replication/*-ca,
cnpg-system CA+webhook, cert-manager webhook CA, cilium/hubble certs, helm
release records, prometheus-operator rendered prompts. Full table in
docs/secrets-sops.md.
Key locations (never in git): Secret flux-system/sops-age (age.agekey) and
/root/sops/homek8s-age.key on the Linode, reached only over the mesh.
2026-11-27 00:17:47 -05:00
|
|
|
# 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
|
secrets: SOPS the backup SSH key and monitoring's hand-made Secrets (F12, part 2)
Completes F12 on the objects deliberately held back until the delete-and-reconcile
drill on siriusdevops/siriusdevops-contact had proved the path works (it did:
deleted 05:29:03Z, recreated by Flux 05:29:05Z, byte-identical, pod restarted off
the recovered Secret and /health 200 — see docs/secrets-sops.md).
* cluster-backup-ssh in forgejo, sirius-growth and monitoring — three files, one
plaintext ed25519 key: a Secret cannot cross namespaces and each backup
CronJob mounts its own namespace's copy, so all three must exist and all three
must be rotated together.
* monitoring/grafana-admin, monitoring/grafana-secret-key and
monitoring/alertmanager-telegram, which are the *inputs* the prometheus-operator
and Grafana consume; the operator's rendered prometheus-*/alertmanager-* objects
stay excluded (a second writer would fight it).
* monitoring Kustomization gains the same sops decryption block as apps.
All six files were generated from the live objects and decrypt to a byte-identical
data map and type, so this apply is a no-op.
2026-11-27 00:30:22 -05:00
|
|
|
- secret-cluster-backup-ssh.sops.yaml
|