Skip to content

feat(helm): wire in secret file mounts, reloader, and extra config#3728

Merged
djwhitt merged 1 commit into
feat/helmfrom
davidwhittington/helm-secrets-wiring
Jul 24, 2026
Merged

feat(helm): wire in secret file mounts, reloader, and extra config#3728
djwhitt merged 1 commit into
feat/helmfrom
davidwhittington/helm-secrets-wiring

Conversation

@djwhitt

@djwhitt djwhitt commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Part of O11Y-2137.

Stacked on top of #3719 (feat/helm). Merge target is feat/helm (or main once #3719 lands). Still iterating, so the chart version is intentionally not bumped yet — the version-gate check will be red until it is.

What

Wires the chart to carry the full secret/config surface a real deployment needs, so it can consume the ExternalSecret-materialised Secrets (logflare-secrets, logflare-cert-files) from the k8s-observability side.

  • certFilesSecret / certFilesMountPath — mounts a Secret whose keys are cert filenames (db-server-ca.pem, db-client-cert.pem, db-client-key.pem, cert.pem, cert.key) as files, and sets DB_SSL_CA_CERT_PATH / DB_SSL_CLIENT_CERT_PATH / DB_SSL_CLIENT_KEY_PATH / LOGFLARE_TLS_CERT_PATH / LOGFLARE_TLS_KEY_PATH to point at the mount. Logflare reads these from disk, so envFrom can't deliver them.
  • reloader — optional Stakater Reloader annotation so the Deployment rolls when its ConfigMap or referenced Secrets change (the chart can't checksum Secrets it doesn't own).
  • extraConfig — free-form map of non-secret env vars rendered verbatim into the ConfigMap, for the long tail of config not modeled as first-class values (e.g. SPOOL_*, LIBCLUSTER_TOPOLOGY, GOOGLE_*_SA, per-env cluster sizing).

Notes

  • All new behavior is default-off; existing rendering is unchanged (existing unit tests stay green). Added helm-unittest coverage for each new path and documented them in the README.
  • The BigQuery service-account key is handled as an env-var secret (GOOGLE_APPLICATION_CREDENTIALS_JSON), not a mounted file.
  • Depends on the configurable-path / inline-JSON support in config/runtime.exs (logflare feat(config): make credential and cert paths configurable #3727) for the *_PATH vars and GOOGLE_APPLICATION_CREDENTIALS_JSON to take effect at runtime.
  • Secret var names are deployment-mode dependent (e.g. SaaS uses SUPER_USER_AUTHENTICATION_TOKEN; single-tenant uses LOGFLARE_PUBLIC/PRIVATE_ACCESS_TOKEN). The chart stays agnostic — envFrom injects whatever keys the referenced Secret has — so this isn't hardcoded.

Related PRs

Part of the Logflare-on-Kubernetes secrets migration:

Builds on the initial chart to support the full secret/config surface a
production deployment needs:

- certFilesSecret / certFilesMountPath: mount a Secret of cert/key files
  (DB SSL + gRPC TLS) as files, and point the DB_SSL_*_PATH / LOGFLARE_TLS_*_PATH
  env vars at the mount. Logflare reads these from disk, so envFrom can't carry
  them. (Requires the configurable-path support in logflare runtime.exs.)
- reloader: optional Stakater Reloader annotation so the Deployment rolls when
  its ConfigMap or referenced Secrets change (the chart can't checksum Secrets
  it doesn't own).
- extraConfig: free-form passthrough of non-secret env vars into the ConfigMap,
  for the long tail of configuration not modeled as first-class values.

Adds helm-unittest coverage for each and documents them in the README. All new
behavior is default-off, so existing rendering is unchanged.
@djwhitt
djwhitt marked this pull request as ready for review July 23, 2026 22:45
Comment thread helm/values.yaml
certFilesMountPath: /etc/logflare/certs

# Roll the Deployment automatically when its ConfigMap or referenced Secrets
# change. Requires the Stakater Reloader controller to be installed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like reloading should be done outside of this chart, would defer to @stigglor opinion here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would adding a deploymentAnnotations map to make it open ended be reasonable?

@djwhitt
djwhitt merged commit 7a8a569 into feat/helm Jul 24, 2026
2 checks passed
@djwhitt
djwhitt deleted the davidwhittington/helm-secrets-wiring branch July 24, 2026 15:31
djwhitt added a commit that referenced this pull request Jul 24, 2026
#3736)

* feat(helm): support custom vm.args via RELEASE_VM_ARGS

Adds an opt-in `vmArgs` value rendered into a ConfigMap, mounted at
/etc/logflare/vm.args, and wired via RELEASE_VM_ARGS. Defaults to a set
including `+Q 1048576`, which caps the BEAM's preallocated port table — needed
on Kubernetes, where containerd runs pods with nofile=infinity and the VM would
otherwise size the table from that (~2GB RSS at boot).

Mounted with subPath so it coexists with the cert-files mount under
/etc/logflare. A checksum/vm-args pod annotation rolls the Deployment when the
args change. Set vmArgs to "" to fall back to the image's baked-in vm.args.
Adds helm-unittest coverage.

* feat(helm): replace Stakater-specific reloader toggle with generic deploymentAnnotations

Per review on #3728: the `logflare.reloader` boolean hard-coded a Stakater-
specific annotation, which is too opinionated for a public chart. Replace it
with a generic top-level `deploymentAnnotations` map (mirroring podAnnotations)
that renders onto the Deployment's own metadata.annotations.

This keeps the chart neutral about the reload mechanism — opt into Reloader with
`deploymentAnnotations: { reloader.stakater.com/auto: "true" }` — and fills a
real gap: there was no hook for Deployment-level annotations (podAnnotations
only reaches the pod template). Updates the helm-unittest cases and README.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants