homek8s/apps/base/osint/kustomization.yaml
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

37 lines
1.4 KiB
YAML

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- configmap.yaml
- postgres-pvc.yaml
- postgres-pvc-linode.yaml
- postgres-deployment.yaml
- postgres-service.yaml
- nats-deployment.yaml
- nats-service.yaml
- app-deployment.yaml
- app-service.yaml
- ingester-deployment.yaml
- camera-pvc.yaml
- camera-deployment.yaml
- titiler-deployment.yaml
- titiler-service.yaml
- news-scraper-deployment.yaml
- news-summarizer-deployment.yaml
# Freshness exporter for the analyst (max(article_summaries.batch_timestamp)
# and max(articles.timestamp) -> :9187/metrics) + its ServiceMonitor. The
# summarizer has no /metrics and a wedged analyst is invisible otherwise
# (card t_22334588).
- analyst-exporter.yaml
- httproute.yaml
# Default-deny ingress+egress + the namespace allow list (audit F3 / t_fed52919).
- networkpolicy.yaml
# exec-only RBAC so forgejo/cluster-backup can pg_dump this namespace's plain
# Postgres Deployment (osint-db) — not a CNPG cluster, so it needs its own path.
- backup-exec-rbac.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-pull.sops.yaml
- secret-osint-admin.sops.yaml
- secret-osint-db.sops.yaml