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).
This commit is contained in:
Lance Walters 2026-11-13 20:14:37 -05:00
commit f290b3c457
19 changed files with 649 additions and 0 deletions

View file

@ -0,0 +1,85 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-app
namespace: osint
labels:
app: osint-app
spec:
replicas: 1
selector:
matchLabels:
app: osint-app
template:
metadata:
labels:
app: osint-app
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
initContainers:
# Wait for Postgres before alembic runs (the entrypoint migrates).
- name: wait-for-db
image: forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-c48788d4b614
imagePullPolicy: IfNotPresent
command:
- python
- -c
- |
import os, socket, sys, time
host, port = os.environ.get("DB_HOST", "osint-db"), int(os.environ.get("DB_PORT", "5432"))
deadline = time.time() + 300
while time.time() < deadline:
try:
with socket.create_connection((host, port), timeout=3):
print("postgres is reachable"); sys.exit(0)
except OSError:
time.sleep(3)
sys.exit("postgres did not become reachable in 300s")
containers:
- name: app
image: forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-c48788d4b614
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
name: http
envFrom:
- configMapRef:
name: osint-env
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: osint-db
key: password
readinessProbe:
httpGet:
path: /api/health
port: 8000
initialDelaySeconds: 10
periodSeconds: 15
failureThreshold: 6
livenessProbe:
httpGet:
path: /api/health
port: 8000
initialDelaySeconds: 90
periodSeconds: 30
failureThreshold: 5
volumeMounts:
- name: snapshots
mountPath: /data/snapshots
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 1Gi
volumes:
- name: snapshots
persistentVolumeClaim:
claimName: osint-camera-snapshots

View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: osint-app
namespace: osint
spec:
selector:
app: osint-app
ports:
- name: http
port: 8000
targetPort: 8000

View file

@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-camera-service
namespace: osint
labels:
app: osint-camera-service
spec:
replicas: 1
selector:
matchLabels:
app: osint-camera-service
template:
metadata:
labels:
app: osint-camera-service
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: camera-service
image: forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-c48788d4b614
imagePullPolicy: IfNotPresent
command: ["python", "app/run_camera_service.py"]
envFrom:
- configMapRef:
name: osint-env
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: osint-db
key: password
volumeMounts:
- name: snapshots
mountPath: /data/snapshots
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
memory: 512Mi
volumes:
# Shared with osint-app (same node, RWO): the app serves cached snapshots.
- name: snapshots
persistentVolumeClaim:
claimName: osint-camera-snapshots

View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: osint-camera-snapshots
namespace: osint
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 3Gi

View file

@ -0,0 +1,62 @@
# Shared, non-secret runtime configuration for every OSINT workload.
# Secrets (Postgres password, Nous API key, FIRMS/AIS keys) are NOT here:
# * Postgres password -> Secret `osint-db` (created out of band, never in git)
# * API keys -> dashboard Keys page, stored in the `api_keys` table
apiVersion: v1
kind: ConfigMap
metadata:
name: osint-env
namespace: osint
data:
DB_HOST: osint-db
DB_PORT: "5432"
DB_NAME: osint_data
DB_USER: osint
NATS_URL: nats://osint-nats:4222
# SAR tile proxy, exposed same-origin under /titiler by the HTTPRoute.
TITILER_INTERNAL_URL: http://osint-titiler:8000
TITILER_PUBLIC_BASE: /titiler
TZ: America/New_York
OSINT_USER_AGENT: "osint-dashboard/1.0 (self-hosted; [email protected])"
# ── ingester ────────────────────────────────────────────────────────────
INGEST_INTERVAL: "300"
INGEST_EARTHQUAKES: "1"
INGEST_FIRES: "1"
FIRMS_DATASETS: "VIIRS_NOAA20_NRT,VIIRS_NOAA21_NRT"
FIRMS_BBOX: "-180,-60,180,75"
FIRMS_INTERVAL: "900"
VESSELAPI_BBOX: "25.5,55.4,27.3,57.2"
VESSELAPI_INTERVAL: "17280"
VESSELAPI_MAX_CALLS_PER_DAY: "5"
AISSTREAM_IN_APP: "1"
AISSTREAM_IN_INGEST: "0"
VESSELAPI_IN_APP: "0"
VESSELAPI_IN_INGEST: "1"
# ── camera discovery service ────────────────────────────────────────────
CAMERA_SOURCE_URLS: ""
CAMERA_SCRAPE_INTERVAL: "3600"
CAMERA_REQUEST_DELAY: "2.0"
CAMERA_MAX_PER_SOURCE: "20000"
NOMINATIM_URL: https://nominatim.openstreetmap.org
NOMINATIM_MIN_INTERVAL: "1.1"
SNAPSHOT_CACHE_DIR: /data/snapshots
SNAPSHOT_TTL_SECONDS: "300"
# ── news scraper ────────────────────────────────────────────────────────
LOG_LEVEL: INFO
NEWS_SCRAPE_INTERVAL_S: "10"
NEWS_SCRAPE_RUN_ON_START: "1"
# ── news summarizer (analyst) — Nous Portal, free tier model ────────────
NOUS_BASE_URL: https://inference-api.nousresearch.com/v1
SUMMARY_MODEL: meituan/longcat-2.5:free
BATCH_SIZE: "50"
NEWS_SUMMARIZE_INTERVAL_S: "900"
NEWS_SUMMARIZE_RUN_ON_START: "1"
NEWS_RECAP_HOUR: "23"
NEWS_RECAP_MINUTE: "0"
INCLUDE_FUTURES: "0"

View file

@ -0,0 +1,34 @@
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: osint
namespace: osint
spec:
parentRefs:
- name: public
namespace: gateway-system
hostnames:
- osint.siriusdevops.com
rules:
# Same-origin SAR tile proxy: /titiler/... -> titiler /... (prefix stripped,
# matching the old nginx vhost's `proxy_pass ...:8001/`).
- matches:
- path:
type: PathPrefix
value: /titiler
filters:
- type: URLRewrite
urlRewrite:
path:
type: ReplacePrefixMatch
replacePrefixMatch: /
backendRefs:
- name: osint-titiler
port: 8000
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: osint-app
port: 8000

View file

@ -0,0 +1,43 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-ingester
namespace: osint
labels:
app: osint-ingester
spec:
replicas: 1
selector:
matchLabels:
app: osint-ingester
template:
metadata:
labels:
app: osint-ingester
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: ingester
image: forgejo.siriusdevops.com/sirius/osint-dashboard:amd64-c48788d4b614
imagePullPolicy: IfNotPresent
command: ["python", "app/run_ingester.py"]
envFrom:
- configMapRef:
name: osint-env
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: osint-db
key: password
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 512Mi

View file

@ -0,0 +1,20 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- configmap.yaml
- postgres-pvc.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
- httproute.yaml

View file

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: osint

View file

@ -0,0 +1,53 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-nats
namespace: osint
labels:
app: osint-nats
spec:
replicas: 1
selector:
matchLabels:
app: osint-nats
template:
metadata:
labels:
app: osint-nats
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: nats
image: forgejo.siriusdevops.com/sirius/nats:2.10
imagePullPolicy: IfNotPresent
args: ["-js", "-sd", "/data"]
ports:
- containerPort: 4222
name: client
- containerPort: 8222
name: monitor
volumeMounts:
- name: data
mountPath: /data
readinessProbe:
httpGet:
path: /healthz
port: 8222
initialDelaySeconds: 5
periodSeconds: 10
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
memory: 256Mi
volumes:
# JetStream is a transient bus here (compose had no volume either):
# events are written to Postgres by the consumer loop.
- name: data
emptyDir: {}

View file

@ -0,0 +1,15 @@
apiVersion: v1
kind: Service
metadata:
name: osint-nats
namespace: osint
spec:
selector:
app: osint-nats
ports:
- name: client
port: 4222
targetPort: 4222
- name: monitor
port: 8222
targetPort: 8222

View file

@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-news-scraper
namespace: osint
labels:
app: osint-news-scraper
spec:
replicas: 1
selector:
matchLabels:
app: osint-news-scraper
template:
metadata:
labels:
app: osint-news-scraper
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: news-scraper
image: forgejo.siriusdevops.com/sirius/osint-news-scraper:amd64-c48788d4b614
imagePullPolicy: IfNotPresent
# Image ENTRYPOINT is `scrapy`; the loop crawls, sleeps, crawls again.
command: ["python", "run_news_scraper.py"]
envFrom:
- configMapRef:
name: osint-env
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: osint-db
key: password
resources:
requests:
cpu: 100m
memory: 256Mi
limits:
memory: 768Mi

View file

@ -0,0 +1,44 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-news-summarizer
namespace: osint
labels:
app: osint-news-summarizer
spec:
replicas: 1
selector:
matchLabels:
app: osint-news-summarizer
template:
metadata:
labels:
app: osint-news-summarizer
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: news-summarizer
image: forgejo.siriusdevops.com/sirius/osint-news-summarizer:amd64-c48788d4b614
imagePullPolicy: IfNotPresent
# Loop: batch the last window, call Nous Portal, write summaries.
command: ["python", "run_news_summarizer.py"]
envFrom:
- configMapRef:
name: osint-env
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: osint-db
key: password
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
memory: 512Mi

View file

@ -0,0 +1,82 @@
# TimescaleDB + PostGIS, single instance on local-path.
# NOT CloudNativePG: the app's alembic chain requires CREATE EXTENSION
# postgis AND timescaledb plus create_hypertable()/continuous aggregates, and
# this image (Dockerfile.pg, built amd64) is the exact Postgres the Pi stack
# ran. A CNPG cluster would need a custom CNPG-conformant Timescale image.
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-db
namespace: osint
labels:
app: osint-db
spec:
replicas: 1
# ReadWriteOnce PVC: old and new pod cannot both mount it.
strategy:
type: Recreate
selector:
matchLabels:
app: osint-db
template:
metadata:
labels:
app: osint-db
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: postgres
image: forgejo.siriusdevops.com/sirius/osint-dashboard-pg:amd64-c48788d4b614
imagePullPolicy: IfNotPresent
args:
- -c
- shared_preload_libraries=timescaledb
- -c
- shared_buffers=1GB
- -c
- max_connections=100
ports:
- containerPort: 5432
name: postgres
env:
- name: POSTGRES_USER
value: osint
- name: POSTGRES_DB
value: osint_data
- name: PGDATA
value: /var/lib/postgresql/data/pgdata
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: osint-db
key: password
readinessProbe:
exec:
command: ["pg_isready", "-U", "osint", "-d", "osint_data", "-h", "127.0.0.1"]
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 6
livenessProbe:
exec:
command: ["pg_isready", "-U", "osint", "-d", "osint_data", "-h", "127.0.0.1"]
initialDelaySeconds: 60
periodSeconds: 30
failureThreshold: 6
volumeMounts:
- name: pgdata
mountPath: /var/lib/postgresql/data
resources:
requests:
cpu: 200m
memory: 512Mi
limits:
memory: 2Gi
volumes:
- name: pgdata
persistentVolumeClaim:
claimName: osint-pgdata

View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: osint-pgdata
namespace: osint
spec:
accessModes:
- ReadWriteOnce
storageClassName: local-path
resources:
requests:
storage: 15Gi

View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: osint-db
namespace: osint
spec:
selector:
app: osint-db
ports:
- name: postgres
port: 5432
targetPort: 5432

View file

@ -0,0 +1,51 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: osint-titiler
namespace: osint
labels:
app: osint-titiler
spec:
replicas: 1
selector:
matchLabels:
app: osint-titiler
template:
metadata:
labels:
app: osint-titiler
spec:
tolerations:
- key: dedicated
operator: Exists
effect: PreferNoSchedule
nodeSelector:
kubernetes.io/hostname: siriussec
containers:
- name: titiler
image: forgejo.siriusdevops.com/sirius/titiler:0.26.0
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8000
name: http
env:
- name: PORT
value: "8000"
- name: WORKERS_PER_CORE
value: "1"
- name: WEB_CONCURRENCY
value: "1"
- name: GDAL_CACHEMAX
value: "128"
readinessProbe:
httpGet:
path: /healthz
port: 8000
initialDelaySeconds: 5
periodSeconds: 15
resources:
requests:
cpu: 50m
memory: 128Mi
limits:
memory: 512Mi

View file

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: osint-titiler
namespace: osint
spec:
selector:
app: osint-titiler
ports:
- name: http
port: 8000
targetPort: 8000

View file

@ -5,3 +5,4 @@ resources:
- ../base/siriusdevops
- ../base/piedmont
- ../base/sirius-growth
- ../base/osint