Files
argocd-apps/apps/overlays/au-syd1/logging/values-nats.yaml
T
Ben Vincent 8ce1b5f6bd
ci/woodpecker/pr/kubeconform Pipeline was successful
ci/woodpecker/pr/vector-test Pipeline failed
ci/woodpecker/pr/pre-commit Pipeline failed
Enable Reloader secret watching, scope existing auto to configmap-only (#326)
The internal intermediate CA re-key broke CA consumers because Reloader
ignored Secrets and could not restart on the vault-ca-cert Secret. Enabling
generic secret watching naively would restart every workload on each
Vault/VSO secret rotation, so this scopes existing auto annotations to
ConfigMaps and makes secret reload opt-in per Secret.

- set reloader ignoreSecrets: false so Secrets are watched
- convert every generic reloader.stakater.com/auto to the configmap-only
  configmap.reloader.stakater.com/auto form (22 annotations, 19 files)
- add explicit secret.reloader.stakater.com/reload: "vault-ca-cert" to the CA
  consumers (artifactapi api, cephrgw-operator, puppetserver master+compiler,
  litellm, logarchiver) so CA rotation restarts them
- add secret.reloader.stakater.com/reload: "kanidm-tls" so the cert-manager
  leaf renewal rolls kanidm
- add docs/ca-rotation.md runbook and index it

Closes #326

Claude-Session: https://claude.ai/code/session_01JUoARVdmhxKQHyyyp1pxeT
2026-08-08 18:40:37 +10:00

105 lines
3.5 KiB
YAML

# Dedicated JetStream-enabled NATS cluster for the log bus. Deliberately NOT
# shared with app messaging (streamstack et al. run their own NATS in their own
# repo) — a separate cluster isolates logging blast-radius from app messaging
# and lets us size retention/storage purely for the log outage-buffer + replay
# use-case.
fullnameOverride: nats
config:
cluster:
enabled: true
replicas: 3
jetstream:
enabled: true
fileStore:
pvc:
# Sized for 3d retention: ~100 GiB/3d compressed (see
# nats-stream-limits ConfigMap) + file-store WAL/index/overhead, kept
# safely above the 130 GiB max_bytes cap. 3 replicas => ~0.5 TiB total
# provisioned on cephrbd-fast-delete. NB: this is the honest number for
# the assumed ~1500 events/s; higher real volume needs a bigger PVC +
# max_bytes together, else discard=old truncates retention below 3d.
size: 180Gi
storageClassName: cephrbd-fast-delete
# Per-user auth with publish/subscribe separation. Passwords are injected as
# env vars from the Vault-synced nats-auth Secret. The `<< $VAR >>` wrapping is
# REQUIRED by this chart: it renders the value UNQUOTED in nats.conf so the
# NATS server expands the env var. A plain `$VAR` is JSON-quoted ("$VAR") and
# NATS then treats it as a literal string — which broke auth for every client.
merge:
authorization:
users:
# Bootstrap Job (stream/consumer management) — full JetStream API.
- user: log-admin
password: << $NATS_ADMIN_PASSWORD >>
# Edge publishers (k8s DaemonSet + VM ingest) — publish only.
- user: log-producer
password: << $NATS_PRODUCER_PASSWORD >>
permissions:
publish:
allow:
- "logs.>"
subscribe:
allow:
- "_INBOX.>"
# Consumers (transform tier + archiver) — pull + ack only, no publish
# to log subjects.
- user: log-consumer
password: << $NATS_CONSUMER_PASSWORD >>
permissions:
publish:
allow:
- "$JS.API.CONSUMER.>"
- "$JS.API.STREAM.INFO.>"
- "$JS.ACK.LOGS.>"
subscribe:
allow:
- "_INBOX.>"
container:
# Pulled through the artifactapi dockerhub remote (upstream official nats;
# no DHI variant available for nats).
image:
repository: artifactapi.k8s.syd1.au.unkin.net/dockerhub/library/nats
tag: 2.14.2-alpine
env:
NATS_ADMIN_PASSWORD:
valueFrom:
secretKeyRef:
name: nats-auth
key: admin_password
NATS_PRODUCER_PASSWORD:
valueFrom:
secretKeyRef:
name: nats-auth
key: producer_password
NATS_CONSUMER_PASSWORD:
valueFrom:
secretKeyRef:
name: nats-auth
key: consumer_password
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: "2"
memory: 4Gi
# Roll the StatefulSet on config changes only; nats-auth is Vault-rotated (VSO)
# so it is deliberately not watched here (no restart on routine key rotation).
podTemplate:
merge:
metadata:
annotations:
configmap.reloader.stakater.com/auto: "true"
# Config-reloader sidecar image, also through artifactapi.
reloader:
image:
repository: artifactapi.k8s.syd1.au.unkin.net/dockerhub/natsio/nats-server-config-reloader
tag: "0.23.0"
natsBox:
enabled: false