Skip to content

feat(helm): align engine overrides and connection options (FB-4387) - #117

Open
simonzelenskifbio wants to merge 9 commits into
FB-4386-certificate-lifecyclefrom
FB-4387-configuration-options
Open

simonzelenskifbio wants to merge 9 commits into
FB-4386-certificate-lifecyclefrom
FB-4387-configuration-options

Conversation

@simonzelenskifbio

@simonzelenskifbio simonzelenskifbio commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Background

FB-4387: Engine overrides are inconsistently applied and the chart lacks explicit ephemeral storage, query-parameter routing, and verified TLS for external PostgreSQL.

Summary

Resolve Engine settings once across pods, ports, config, and certificates. Explicit per-Engine false/empty values replace defaults; image fields and PVC storage fields inherit individually. Keep installation identity global, support mixed ServiceAccounts, and disable automatic API token mounting at pod level. Move default resource sizing into engineSpec so custom Engines inherit it.

Add opt-in emptyDir local storage alongside the default retained PVC and legacy hostPath paths. Existing StatefulSets require a planned storage migration. Accept validated engine= URL routing, remove the selector before forwarding, and reject duplicates/conflicts. Add external PostgreSQL verify-full TLS with a CA Secret, rollout tracking, and a Helm authentication hook. Update generated values documentation and usage guides.

Stack 5/6 for FB-4382, based on #114. Merge order: #111 → #112 → #113 → #114 → this PR. Scope is the Helm chart; no operator changes.

Test Plan

  • Helm 3.16.3 strict lint and full validate-chart.sh, 16 render regressions, generated docs, and docs navigation checks passed.
  • Real Envoy Docker fixture passed: delivered requests are not replayed, drained requests retry, active queries finish during drain, and query-selector parsing/stripping/conflict handling works.
  • Dedicated kind cluster: full agent-verify THOROUGH=true passed, including managed-table create/insert/select/drop and URL-selector hooks.
  • Added an emptyDir Engine alongside a PVC Engine; both became ready and the full Helm test suite, including SQL writes for each, passed.
  • Isolated external PostgreSQL TLS fixture: the pinned Metadata Service became ready, PostgreSQL reported both Metadata Service connections as SSL, and the CA-verifying credential hook passed. A mismatched PostgreSQL hostname was rejected with an explicit certificate-name mismatch.
  • Earlier stack validation covered Engine/Gateway TLS with a private CA and verified rejection of the wrong Gateway hostname.

These checks establish the tested deployment paths, not zero-downtime Engine rollout or automatic certificate/CA rotation guarantees. The local SQL tests needed a 4 GiB Engine limit; the 2 GiB agent overlay ran out of memory during INSERT.

Stack navigation: #111 → #112 → #113 → #114 → #117 → #120. Parent: FB-4382. All PRs remain drafts; merge in this order.

Audit follow-up: DNS, reachability, and readiness hooks now honor each Engine’s effective nodeHostSuffix. Corrected PostgreSQL TLS and supplied-ServiceAccount documentation and regenerated helm-docs. The approved final stack passes 18 render tests, full chart validation, and docs checks. Full SQL/Helm hooks passed on the local TLS-enabled release after certificate replacement.


Note

Medium Risk
Touches engine StatefulSet volumes (storage backend changes are migration-sensitive), gateway request routing, and Metadata Service database TLS—operational misconfiguration can break queries or DB connectivity.

Overview
Aligns how per-engine settings are applied by resolving each engine once via fbinstance.effectiveEngine across StatefulSets, services, config, and TLS SANs. Explicit per-engine values (including false, [], {}) replace shared engineSpec defaults; image and PVC storage fields still merge field-by-field. Default sizing moves into engineSpec.resources, with optional per-engine customEngineConfig overlays (but not instance.id). Mixed ServiceAccounts are supported and every engine pod sets automountServiceAccountToken: false.

Adds engineSpec.storageType (pvc, emptyDir, hostPath) with legacy hostPathStorageEnabled mapping and validation when combined with emptyDir. Gateway routing moves to files/gateway-routing.lua, accepting engine= in the query string (stripped before upstream), cross-checking X-Firebolt-Engine, and returning 400 on invalid/duplicate/conflicting selectors.

For external PostgreSQL, postgresql.tls enables verify-full (PGSSLMODE / CA mount on the Metadata Service), render-time validation, CA Secret checksum rollouts, and updated security/usage docs plus Helm tests and hooks.

Reviewed by Cursor Bugbot for commit 064a78c. Bugbot is set up for automated code reviews on this repo. Configure here.

@fireboltdb-docs-integration

fireboltdb-docs-integration Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Mintlify docs preview

Docs were aggregated into the Firebolt documentation site.

Status Preview Updated (UTC)
🟢 Ready View Preview Oct 02, 2026, 10:47 AM

Mintlify may take a few minutes to finish building. This comment updates on each sync while the source PR is open.

@simonzelenskifbio
simonzelenskifbio marked this pull request as ready for review October 1, 2026 15:33
value: {{ .Values.postgresql.credentials.mountPath }}/username
- name: POSTGRES_PASSWORD_FILE
value: {{ .Values.postgresql.credentials.mountPath }}/password
{{- if .Values.postgresql.tls.enabled }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Agentic Security Review

Severity: MEDIUM

Description: postgresql.tls.enabled documents verify-full but the Metadata Service connection is not bound to that gate. The chart mounts a CA and sets libpq PGSSLMODE/PGSSLROOTCERT, while dedicated-pensieve is configured from config.yaml plus POSTGRES_*_FILE, and this PR renamed the reserved TLS env from POSTGRES_SSLMODE/POSTGRES_SSLROOTCERT to the libpq names without adding sslmode/CA fields on metadata_storage.postgresql.

Impact: An operator who sets postgresql.tls.enabled expects certificate-chain and hostname verification on the Metadata Service → external PostgreSQL path. If that client ignores PGSSLMODE, the new gate is fail-open: an on-path attacker can still intercept metadata-store traffic and database credentials. That matters because the PR replaces the previous 'encrypt at the network layer' guidance with a claimed verify-full control, so installers can drop the old mitigation while the actual Pensieve client is unchanged.

Remediation: Drive TLS from the same Metadata Service surface as host and credentials: set POSTGRES_SSLMODE/POSTGRES_SSLROOTCERT (or add sslmode/sslrootcert on metadata_storage.postgresql) and fail closed if dedicated-pensieve cannot apply verify-full to postgresql.host. Do not treat a green helm test-postgres (psql/libpq) as proof the Metadata Service client verifies the chain and hostname. Restore the previous network-layer-TLS caveat until that binding is demonstrated against /dedicated-pensieve.

@cursor
cursor Bot requested review from fstr and gm42 October 1, 2026 15:41

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Left a non-blocking comment; this automation did not approve. Cursor Security Agent reported an unresolved medium finding that the Metadata Service Postgres TLS path is not bound to postgresql.tls.enabled verify-full. Assigned fstr and gm42 for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7548616. Configure here.

Comment thread helm/templates/_helpers.tpl Resolved

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Left a non-blocking comment; this automation did not approve because the PR exceeds the medium risk threshold (engine StatefulSets, gateway routing, storage-type migration, and Metadata Service PostgreSQL TLS). Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Left a non-blocking comment; this automation did not approve. The change set still includes engine StatefulSet, gateway routing, storage-type, and Metadata Service TLS paths, which is above the medium approval threshold, and an unresolved Security Agent finding remains on the Postgres TLS binding. Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Left a non-blocking comment; this automation did not approve because Cursor Bugbot stayed pending past the 8-minute wait and the change set exceeds the medium approval threshold. Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Left a non-blocking comment; this automation did not approve because Cursor Bugbot did not finish within the wait window, and engine StatefulSet, gateway routing, storage-type, and Metadata Service TLS changes remain above the medium approval threshold. Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Left a non-blocking comment; this automation did not approve because engine StatefulSet, gateway routing, storage-type, and Metadata Service TLS changes remain above the medium approval threshold. Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stale comment

Risk: high. Left a non-blocking comment; this automation did not approve because the change set exceeds the medium risk threshold (engine StatefulSets, gateway routing, storage-type migration, and Metadata Service PostgreSQL TLS). Human review is needed and no reviewers were assigned.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Risk: high. Left a non-blocking comment; this automation did not approve because engine StatefulSets, gateway routing, storage-type migration, and Metadata Service PostgreSQL TLS remain above the medium approval threshold. Cursor Bugbot completed with no unresolved findings; Security Agent was not running. Human review is needed.

Open in Web View Automation 

Sent by Cursor Approval Agent: Infra Reviewer

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.

1 participant