feat(backup): pinned backup-tools image + egress allow list for the three nightly jobs #87

Merged
sirius merged 3 commits from wt/t_9d0428d8 into master 2026-12-04 05:20:44 +00:00
Owner

Card t_9d0428d8.

apk add --no-cache rsync openssh-client in grafana-backup, cluster-backup and leadgen-backup
reached dl-cdn.alpinelinux.org (Fastly 151.101.x.132:443) on every run: the egress-new-dst
alert, an internet dependency at backup time, and a package install on the pod holding the
Grafana PVC + a backup SSH key.

  • new image sirius/backup-tools built by .forgejo/workflows/backup-image.yml:
    python:3.12-alpine (digest-pinned) + rsync + openssh-client + bash + kubectl v1.36.4
    (release sha256 verified), pushed to the in-cluster Forgejo registry;
    CronJobs pin it by digest @sha256:cc8dc1645111b3a80b7c4d5168f6bce3002cae7417b3725683c057976f6e379a;
    no apk add left in any backup path.
  • CiliumNetworkPolicy per backup pod: DNS + 10.10.0.5:22 (all three), kube-apiserver 6443/443
    (cluster-backup only), explicit world deny so a future runtime fetch fails loudly.
  • monitoring gets forgejo-pull (SOPS) because the job now pulls from the in-cluster registry.

Schedules, retention, destinations, entrypoints, RBAC untouched.

Card t_9d0428d8. `apk add --no-cache rsync openssh-client` in grafana-backup, cluster-backup and leadgen-backup reached dl-cdn.alpinelinux.org (Fastly 151.101.x.132:443) on every run: the `egress-new-dst` alert, an internet dependency at backup time, and a package install on the pod holding the Grafana PVC + a backup SSH key. - new image `sirius/backup-tools` built by `.forgejo/workflows/backup-image.yml`: python:3.12-alpine (digest-pinned) + rsync + openssh-client + bash + kubectl v1.36.4 (release sha256 verified), pushed to the in-cluster Forgejo registry; CronJobs pin it by digest `@sha256:cc8dc1645111b3a80b7c4d5168f6bce3002cae7417b3725683c057976f6e379a`; no `apk add` left in any backup path. - CiliumNetworkPolicy per backup pod: DNS + 10.10.0.5:22 (all three), kube-apiserver 6443/443 (cluster-backup only), explicit `world` deny so a future runtime fetch fails loudly. - monitoring gets `forgejo-pull` (SOPS) because the job now pulls from the in-cluster registry. Schedules, retention, destinations, entrypoints, RBAC untouched.
The three nightly backups (grafana-backup, cluster-backup, leadgen-backup)
installed rsync + openssh-client with apk at container start, so every run
depended on the Alpine CDN (Fastly anycast 151.101.x.132:443) and moved the
egress-new-dst alert whenever that anycast address rotated.

This adds the build only; the CronJob pins land in the next commit. Base image
python:3.12-alpine pinned by digest, kubectl v1.36.4 from dl.k8s.io with its
release sha256, amd64 only (all three jobs are nodeSelector'd to siriussec).
Forgejo's /v2/token answers 403 to the scope set buildx imagetools uses
(measured on this registry), while push and kubelet pull work. The metadata
file is the authoritative digest of the manifest the registry just accepted.
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.
sirius merged commit 5c46d9b82f into master 2026-12-04 05:20:44 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/homek8s!87
No description provided.