Fix logging deploy: enable Vector env interpolation; operator watches logging ns #301
Reference in New Issue
Block a user
Delete Branch "benvin/logging-deploy-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Why
PR #296 merged and deployed, but the stack came up partially broken. Diagnosed live (cluster-admin) — two independent root causes, both fixed here.
Root cause 1 — Vector env-var interpolation is off by default in 0.57
vector-aggregatorandvector-archivercrash-looped withasync_nats::connector: authorization violation;vector-agent/vector-vm-ingestwere "Running" but silently failing to publish.Diagnosis (evidence):
$NATS_*_PASSWORD(anatsCLI login with the real secret value authenticated fine), and the ACL was not the problem (a local repro with the narrow ACL + no stream connects cleanly and returns "stream not found", not an auth violation).${NATS_CONSUMER_PASSWORD}fails. Configuring the server to expect the literal string${NATS_CONSUMER_PASSWORD}makes Vector connect — proving Vector sends the literal, un-interpolated string.vector --helpshows--dangerously-allow-env-var-interpolation— in 0.57${VAR}interpolation is opt-in. An unset-var test confirms interpolation is off (no "unknown env var" error).VECTOR_DANGEROUSLY_ALLOW_ENV_VAR_INTERPOLATION=true→ connects and authenticates.Every tier uses
${...}for auth (${NATS_*_PASSWORD},${CLICKHOUSE_*}), so the env var is added to all four vector deployments. (This slipped past CI becausevector testnever opens the NATS connection.)Root cause 2 — operator watches only its own namespace
kubectl get chi -n loggingshowed thelogsCHI existed but with empty status / no finalizer — the operator never touched it, so thelogging-loggingArgo sync was stuckProgressingon "waiting for healthy state of ClickHouseInstallation/logs", and the PostSync hooks (nats-bootstrap stream+consumers, clickhouse-schema) never ran (no stream → the consumers had nothing to bind even once auth is fixed).Diagnosis: forcing an update event on the CHI produced zero operator reaction; a full operator restart didn't help. The Altinity chart README states
watchNamespaces: [](our value) makes the operator watch only its own namespace (clickhouse-system). The CHI is inlogging.Fix:
watchNamespaces: ["logging"]→ operator configwatch.namespaces.include: [logging].Changes
apps/overlays/au-syd1/logging/values-vector-{agent,vm-ingest,aggregator,archiver}.yaml: addVECTOR_DANGEROUSLY_ALLOW_ENV_VAR_INTERPOLATION=true.apps/overlays/au-syd1/clickhouse-system/values.yaml:watchNamespaces: ["logging"].No NATS ACL change (the original narrow ACL is correct). No secret/base changes.
Expected recovery after merge + sync
logging→ operator restarts → reconciles thelogsCHI → CHI pod comes up healthy.logging-loggingsync unblocks → PostSync hooks run → JetStreamLOGSstream +transform/archiverconsumers created;logs.rawtable created.nats stream info LOGSshows messages;SELECT count() FROM logs.rawincreases.Validation
kustomize build + kubeconform clean (clickhouse-system 22, logging 40); operator config renders
watch.namespaces.include: [logging]; all 4 vector deployments carry the interpolation env; pre-commit clean. The interpolation fix was verified end-to-end against a real nats-server (fails without the flag, connects with it).https://claude.ai/code/session_015ur3i7D2azsMAWTSVABApv