Commit graph homek8s/apps/base/sirius-growth
Author SHA1 Message Date
devops
c45255242b db(portal): migrate WAL archiving to the CNPG-I Barman Cloud plugin
CloudNativePG 1.30 deprecates spec.backup.barmanObjectStore and 1.31 removes
it, so the pin on 1.30.0 was a hard gate. This closes that gate:

- Vendors plugin-barman-cloud v0.16.0 verbatim into
  infrastructure/databases/base/upstream/ (the operator manifest's pattern),
  with a kustomize patch only for --log-level=info and resource bounds.
  v0.16.0 requires CNPG >= 1.30 and is registered through Service
  annotations; its operator<->plugin mTLS pair comes from cert-manager
  (previous commit).
- Adds ObjectStore sirius-growth/portal-wal: the literal translation of the
  retired barmanObjectStore block, with retentionPolicy 14d moved off the
  Cluster (in the plugin, retention belongs to the store).
- Cluster portal drops spec.backup entirely and gains spec.plugins
  (barman-cloud.cloudnative-pg.io, isWALArchiver, barmanObjectName
  portal-wal, serverName portal). The server name is the barman prefix, so
  the plugin keeps writing s3://pg-wal-archive/portal/{base,wals}/... — the
  same objects the in-tree archiver left behind; the 14-day window stays
  readable.
- ScheduledBackup portal-daily switches to method: plugin.
- databases waits on cert-manager; apps waits on databases (the ObjectStore
  CRD ships with the plugin).
- CNPG dashboard: the backup timestamp metric family changes name under the
  plugin, so the panel now accepts both.
2026-11-19 17:58:12 -05:00
Lance Walters
953be9f3cf backup(portal): barman-cloud PITR via a Linode-side Garage WAL archive
sirius-growth/portal had a 24h-RPO pg_dump and no way to roll forward. This adds
continuous WAL archiving + a daily base backup into a second, independent Garage
node on the Linode (bucket pg-wal-archive, 10.10.0.5:3900, WireGuard-only), and
proves a restore to a point in time end to end.

- infrastructure/garage-linode/: podman+quadlet unit (the Linode is a kubelet
  node, no docker), garage.toml bound to 10.10.0.5 only, nft guard in PREROUTING
  -140, install.sh, README with the measured disk sizing, pitr-restore.md with
  the rehearsal transcript.
- apps/base/sirius-growth/cluster.yaml: spec.backup.barmanObjectStore
  (destinationPath s3://pg-wal-archive, gzip WAL+data, retentionPolicy 14d),
  credentials from Secret sirius-growth/portal-wal-s3 (out of band, not in git).
- apps/base/sirius-growth/scheduled-backup.yaml: ScheduledBackup portal-daily,
  03:20 UTC, six-field cron.
- docs/cluster-overview.md: §5.1 the WAL store, §8.1 coverage + sizing + gaps,
  §8.3 the PITR restore recipe.

forgejo/pg is deliberately left on pg_dump only (a day of git history is
annoying, not costly); portal keeps its nightly dump as the logical second copy.

Rehearsed 2026-11-19: marker row at 22:35:06Z, unwanted row at 22:35:28Z,
throwaway cluster restored to targetTime 22:35:15Z came back with the marker and
without the later row. See infrastructure/garage-linode/pitr-restore.md.
2026-11-19 17:46:27 -05:00
Lance Walters
c1fe485469 apps(backup): cover the remaining stateful gaps off-host
Four pieces of state were still only on the machine they run on. All four now
land on the Linode over the WireGuard mesh, in the same /root/cluster-backup
tree (or /root/pihost-backup for the Pi) with the same manifest/sha256 habit:

* monitoring/kube-prometheus-stack-grafana — new CronJob `monitoring/grafana-backup`.
  The image is -distroless (no shell), so this mounts the PVC read-write and
  takes a consistent copy with the sqlite backup API (PRAGMA integrity_check on
  the copy), then streams it: grafana/grafana-<stamp>.db, keep 14.
* osint/osint-db — plain Postgres Deployment, so neither the CNPG primary lookup
  nor CNPG_TARGETS reaches it. `forgejo/cluster-backup` gains a PG_TARGETS loop
  that pg_dump -Fc's inside the pod using its own POSTGRES_USER/POSTGRES_DB
  (exec-only RBAC in apps/base/osint/), sha256 checked on both sides.
* sirius-growth/sgs-leadgen-data — new CronJob `sirius-growth/leadgen-backup`,
  link-dest snapshot mirror, keep 7.
* Pi /etc/wireguard + wgportal sqlite — infrastructure/wireguard/backup/,
  nightly systemd timer -> [email protected]:/root/pihost-backup, keep 14.

Each tree carries its own retention, so adding artifacts cannot crowd the
Linode. Docs §8/§8.1/§8.2 record coverage, the accepted gaps (Prometheus TSDB,
camera frames, runner scratch) and the restore procedure — including the
TimescaleDB pre/post-restore calls osint needs.
2026-11-19 17:14:36 -05:00
Lance Walters
b698f23d4f 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
Lance Walters
6049a09c6e apps(sirius-growth): pin blog 4378680 (new SG-tree mark, favicon-32, apple-touch-icon) 2026-11-06 16:36:06 -05:00
Lance Walters
017718ba41 apps(sirius-growth): pin site 413d98f (new SG-tree logo icons) 2026-11-06 16:19:05 -05:00
Lance Walters
fd555ffb87 apps(sirius-growth): pin site 494632d (radish hero plate restored, two-column hero) 2026-11-05 21:08:57 -05:00
Lance Walters
c4f7e6378e apps(sirius-growth): pin site 2b10d99 (hero plate removed, one-column hero) 2026-11-05 20:50:04 -05:00
Lance Walters
aa71da2f31 apps(sirius-growth): blog Deployment/Service + pin site d44446c (journal mount)
- deployment-blog.yaml / service-blog.yaml: blog FastAPI on 8092, siriussec,
  env from sirius-growth-blog-app + sirius-growth-blog-s3,
  PUBLIC_BASE_URL=https://siriusgrowthsolutions.com/journal. No HTTPRoute: the
  site nginx proxies /journal to this ClusterIP service.
- deployment.yaml: site 4285926 -> d44446c (nginx /journal proxy, nav menu).
- portal Deployment untouched.
2026-11-05 13:07:26 -05:00
Lance Walters
be8233079b apps(sirius-growth): pin portal ce350ed + site 4285926 (calendar page, feed kind, application series) 2026-11-05 11:39:32 -05:00
Lance Walters
1fb49c0507 apps(sirius-growth): pin portal efd5b61 + site 7d7fd4c (phase 3: action items, .ics feed, alerts, print view) 2026-11-04 01:39:11 -05:00
Lance Walters
5a9400790c apps(sirius-growth): wire TG_TOKEN/TG_CHAT into the portal from sirius-growth-contact
The portal-api image gained Telegram-only operator alerts (phase 3C) but reads
TG_TOKEN/TG_CHAT at startup; unset, it logs one line and no-ops. Reuse the same
bot and secret the contact service already uses - no new secret, no value in git.
2026-11-04 01:39:10 -05:00
Lance Walters
b7f5e0105d apps(sirius-growth): pin portal 71c7eec + site a72ea75 (phase 2: crew logging schema, thread attachments)
portal-api: multipart message attachments with magic-byte sniffing, owner-checked
GET /api/portal/attachments/{id}; measured_by/application logging with
logged_by_role. site: crew self-logging forms, Specialist/Crew badges, photo
picker + lazy inline thumbnails.
2026-11-04 00:41:01 -05:00
Lance Walters
6cfa86d25d apps(sirius-growth): pin site 1bdcdcd (phase 1 dashboard: baseline panel, target bands, readings table) 2026-11-03 23:42:31 -05:00
Lance Walters
07caa865da apps(sirius-growth): pin portal 540ca05 (phase 1 diagnostics API: input readings, zone targets, site baseline) 2026-11-03 23:42:31 -05:00
Lance Walters
e4c7fd9ff7 apps(sirius-growth): pin site 040d3e1 (root-absolute admin CSS/JS)
site :040d3e1d5c6bae57c7b4d5edd00b4a969bb8718d (deploy-site run 91,
success) loads style.css/portal.css/portal.js root-absolute so
/admin/leads and /admin/settings stop 404ing on /admin/css/… and
/admin/js/… and the Leads table renders. Registry digest
sha256:bd83baa6…ffcd. Portal pin untouched.
2026-11-03 21:33:01 -05:00
Lance Walters
a80d7e233f apps(sirius-growth): pin portal 0f156d2 + site 0b4a8c0 (admin split, zones, messages, inline files)
portal :0f156d2f17aab3461ba4c5d7d4d8988861b2b14b (deploy-portal run 87,
success) carries the zones API (bcdba9d), inline file disposition and the
last-message fields; registry digest sha256:90d9c89d...6643.

site :0b4a8c0a27c35855eab03ebaa23a7ab5229245a8 (deploy-site run 90, success)
is the admin split plus per-client zones/messages UI and the dashboard zone
filter with inline previews, and gates /admin/leads + /admin/settings in all
three nginx variants; registry digest sha256:ab680c5b...5adf.
2026-11-03 21:14:54 -05:00
Lance Walters
695bd90449 apps(sirius-growth): pin portal bcdba9d (named zones per client) 2026-11-03 20:38:59 -05:00
Lance Walters
6ca43350fa apps(sirius-growth): pin portal f02cea9 + site b274454 (onboarding validation errors) 2026-11-03 19:44:35 -05:00
Lance Walters
b68b22288e apps(sirius-growth): pin site ed3ca8f (root-check hook band + second diagnostics link) 2026-11-03 14:36:19 -05:00
Lance Walters
c2b502ba57 apps(sirius-growth): pin site db63ff1 (admin password 401 redirects to /signin?next=/admin) 2026-11-03 13:17:40 -05:00
5036d853bf SGS portal: nginx login gate — rate-limit /api/portal/login (12r/m, burst 6) 2026-11-03 18:16:03 +00:00
Lance Walters
c77b5a6e80 apps(sirius-growth): pin site be32304 (js/css revalidate rule, narrowed to /js/ /css/) 2026-11-03 13:13:42 -05:00
Lance Walters
418f2c5fc0 apps(sirius-growth): pin portal adbf227 (Cache-Control: no-store on /api/portal/*) 2026-11-03 12:49:44 -05:00
Lance Walters
45c3b8533b apps(sirius-growth): sgs-leadgen weekly CronJob (ET) + monthly NCDA job + state PVC
Runs the published amd64 image forgejo.../sgs-leadgen:eef9358 with DATABASE_URL
from sirius-growth-portal-app and the contact bot's Telegram pair; /data on a
local-path PVC pins to siriussec, /tmp on an emptyDir so the root fs stays RO.
2026-11-03 12:46:27 -05:00
Lance Walters
d5193c2525 apps(sirius-growth): pin site c03101f3 (admin UI) and portal a150b6f3 (leads/password/remove) 2026-11-03 12:36:37 -05:00
Lance Walters
c2c7e8d9e7 apps(sirius-growth): pin the site to 37329e3 (alt-band alignment fix) 2026-11-03 12:21:24 -05:00
Lance Walters
5c6c8b71c0 apps: re-pin the contact APIs to their new :sha tags
Both contact APIs now have amd64 build+push pipelines:
sirius-growth/.forgejo/workflows/deploy-contact.yml (contact-api/)
and sirius/websites/.forgejo/workflows/deploy-phs-contact.yml
(phs-contact-api/). Each printed the tag for its first run, so the
@sha256: pins (which existed only because there was no build path)
become ordinary :<sha> tags an operator can bump.

docs/site-image-pinning.md: drop the 'no CI build path' section and
record the two workflows in the pins table.
2026-11-02 18:09:48 -05:00
Lance Walters
41bacb90e4 apps: retire the site-deployer ServiceAccount
Nothing in CI holds cluster credentials any more: every site image is pinned
by tag/digest in this repo and rolled by Flux, so the siriusdevops and
sirius-growth 'site-deployer' SA/Role/RoleBinding are dead. Dropping them from
the kustomizations lets Flux prune all six objects, which also revokes the
8760h tokens behind the KUBE_CONFIG action secrets (deleted separately, and
only after the pins were verified live).

piedmont never had a deployer.yaml: its CI identity (phs-site-deployer) was
created out-of-band and is removed by hand in the same change.
2026-11-02 17:22:06 -05:00
Lance Walters
5273a993f2 apps: pin every first-party site image to an immutable ref
Replace ':latest' + imagePullPolicy: Always on all seven site images with a
pinned tag (or digest) and IfNotPresent, so the image a Deployment runs is
chosen by this repo and rolled by Flux, not by CI patching restartedAt.

Every pin is the image that was already running, so the change is a no-op for
visitors: each pinned tag's manifest/config digest equals the running pod's
imageID (siriusdevops-* f0dde2f4, growth-site ea306b7, growth-portal d9e558c4,
phs-site 5b590cd).

sirius-growth-contact and phs-contact have no CI build path (no workflow has
ever pushed anything but :latest for them), so they are pinned by @sha256:
digest rather than inventing a pipeline; documented in
docs/site-image-pinning.md along with the operator flow.
2026-11-02 17:17:36 -05:00
Lance Walters
9e851f4dfe monitoring: custom Forgejo runner, CNPG and workload dashboards from git
Dashboards (uid forgejo-runners, cnpg-postgres, home-lab-workloads) live as
ConfigMaps generated from monitoring/controllers/home/dashboards/build.py and are
loaded by the kube-prometheus-stack grafana sidecar.

Postgres was not scraped at all before this: add a hand-written PodMonitor per
CNPG cluster (release=kube-prometheus-stack, which is what this Prometheus's
podMonitorSelectorNilUsesHelmValues default requires) plus
spec.monitoring.customQueriesConfigMap on both Clusters. enablePodMonitor stays
false — deprecated in CNPG 1.27 and it gives no control over labels.

pg-actions-queries.yaml adds the Forgejo Actions queue/outcome/last_online
metrics that only the forgejo database can answer.

prometheus-node-exporter is no longer pinned to siriussec: the arm64 runner's
jobs are host containers on rpi, so the Pi's root filesystem is the disk that
matters there and kubelet cannot see it.

docs/monitoring-dashboards.md documents the PromQL, the exporter GRANT and the
known unknowns (arm64 per-job breakdown, hostPath PVs have no kubelet volume
stats, single-instance replication, no backups).
2026-10-27 01:32:20 -04:00
Lance
237722b581 ingress: move public apps off the retired linode node onto siriussec
Linode VPSs are shut down. The Gateway listener has to be co-located with the
backend pods (hostNetwork Envoy returns 503 for cross-node backends), so all
public workloads now schedule on siriussec and the tunnel origin points there.

- nodeSelector linode -> siriussec (piedmont, sirius-growth, siriusdevops)
- siriusdevops site/contact now pull rebuilt images from the Forgejo registry
  (the old :dev tags existed only on the dead VPS containerd)
2026-10-20 09:01:24 -04:00
devops
77d658b719 sirius-growth: portal image from CI tag latest, drop hand-pushed digest pin 2026-10-19 03:47:28 -04:00
Lance Walters
90355d4a76 sirius-growth: deploy the portal API on the existing hostname
FastAPI portal on 8091 behind /api/portal, image pinned to the API
commit 406f25c and its manifest digest. Route sits after /api/contact
and before the catch-all. Env comes from the sirius-growth-portal-app
Secret (DB URL, session secret, admin creds, Garage S3 keys); nothing
secret is in git.
2026-10-19 03:30:03 -04:00
Sirius DevOps
73cc883d5e sirius-growth: add CNPG Cluster 'portal' (1 instance, 5Gi local-path on siriussec)
Database only. Bootstraps database/owner 'portal' from the
sirius-growth-portal-db basic-auth Secret. No API or route changes.
2026-10-19 03:03:09 -04:00
Sirius DevOps
bb1ace7041 sirius-growth: declare the CI deployer ServiceAccount
The site repo's CI rolls the Deployment after pushing a new image, using a
kubeconfig stored as a repo secret. The token came from a ServiceAccount that
only existed because it was created by hand; declare it so a cluster rebuild
does not silently break deploys. Namespace-scoped, deployments only,
get/list/patch.
2026-10-19 00:44:48 -04:00
Lance Walters
5854f5a38b feat(sirius-growth): route /api/contact ahead of the page
Same shape as piedmont. The contact Deployment uses the new image.
2026-10-18 16:00:10 -04:00
Lance Walters
562343c33c feat(sirius-growth): route siriusgrowthsolutions.com to the site
No Cloudflare change in this commit. Origin must answer 200 before the tunnel is updated.
2026-10-18 15:26:00 -04:00
Lance Walters
5a98fd620f feat(sirius-growth): deploy the static site on linode
No HTTPRoute: no public hostname has been named. Photos stay on the
Pi Garage listener, which is loopback-only.
2026-10-18 02:52:08 -04:00