Commit graph homek8s/apps/base/osint/kustomization.yaml
Author SHA1 Message Date
Sirius DevOps
e4b1ac59a9 feat(osint): alert when the analyst stops writing briefs
The 2026-11-25..12-04 outage was invisible: deploy/osint-news-summarizer
stayed Running with restarts 0 and INFO batch lines while article_summaries
froze for nine days, and the scraper kept articles fresh (61.5k rows, newest
within minutes). The app has no /metrics endpoint, so add a small read-only
Postgres exporter and two Prometheus rules.

- osint-analyst-exporter (ns osint): stdlib HTTP server on :9187 serving
  osint_analyst_last_success_timestamp_seconds (max article_summaries.
  batch_timestamp), osint_ingest_last_article_timestamp_seconds (max
  articles.timestamp) and osint_analyst_exporter_up. Runs the pinned
  summarizer image (python3 + psycopg2), non-root, read-only rootfs,
  clusterIP Service + ServiceMonitor (release=kube-prometheus-stack).
- NetworkPolicy: one port-scoped ingress rule, monitoring -> :9187. Nothing
  else in monitoring can reach osint.
- monitoring/controllers/home/osint-analyst.yaml: OsintAnalystStale
  (>1h, 30m, warning, with an absent() arm so a dead exporter cannot read as
  healthy) and OsintIngestAliveButNoBrief (articles <2h old while summaries
  >2h old, 10m, warning). Both route through the default Telegram receiver.
2026-12-04 23:18:20 -05:00
Lance Walters
69b003705c 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
c8f0834886 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:18:14 -05:00
Lance Walters
c2cdc2d5c1 apps(osint): move osint-db onto a linode-local PVC
osint-db (TimescaleDB+PostGIS) moves from siriussec's local-path PV to a new
15Gi local-path-linode claim restored from a pg_dump (44,120,765 bytes,
sha256 d74afa6d...30da). The Deployment gets a required linode nodeAffinity
plus an amd64 arch selector; the old osint-pgdata claim and its PV are left
untouched so rollback is one revert of claimName + scheduling.
2026-11-21 16:47:03 -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
f290b3c457 apps(osint): deploy OSINT dashboard stack to k8s at osint.siriusdevops.com
New namespace `osint` with the full dashboard stack ported from the Pi docker
compose file: TimescaleDB+PostGIS Postgres, NATS JetStream, FastAPI app,
ingester, camera-discovery service, TiTiler tile proxy, and the vendored news
pipeline (Scrapy scraper + Nous Portal summarizer).

- Images built amd64 (the Pi CI only builds arm64) and pushed to the Forgejo
  registry as :amd64-c48788d4b614; nats/titiler mirrored there too so every
  pod pulls from one host.
- All workloads pinned to siriussec (Gateway/Envoy co-location, local-path PVs).
- Postgres is a Deployment+PVC, not CNPG: the alembic chain needs postgis +
  timescaledb extensions and create_hypertable().
- HTTPRoute osint.siriusdevops.com: /titiler prefix-stripped to TiTiler,
  everything else to the app (incl. /ws/live).
- DB password is Secret osint-db, created out of band (not in git).
- Analyst model = meituan/longcat-2.5:free on Nous Portal (free tier).
2026-11-13 20:14:42 -05:00