Skip to content

charts/trueforge: add platform integration extension points - #674

Merged
ramantehlan merged 3 commits into
mainfrom
sd/add-wire-truefoundry
Sep 10, 2026
Merged

ramantehlan merged 3 commits into
mainfrom
sd/add-wire-truefoundry

Conversation

@ramantehlan

@ramantehlan ramantehlan commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Prepares the chart to ship as a dependency of the TrueFoundry truefoundry umbrella chart (control plane) while keeping the chart itself platform-neutral: nothing TrueFoundry-specific lands here, only generic extension points the parent chart drives.

Bumps the chart to 0.1.6-rc.3.

Changes

  • env map (server + controller): entries are scalars or {valueFrom: secretKeyRef|configMapKeyRef|fieldRef}. A key here replaces the chart-computed variable of the same name (e.g. POSTGRES_HOST, PUBLIC_BASE_URL), so it doubles as the override mechanism. This is how a parent chart injects platform env (TRUEFOUNDRY_*).
  • apiKey value wired to TRUEFORGE_API_KEY on both deployments (string or valueFrom). The chart fails fast on an empty key: the server always runs STANDALONE=false and the app rejects an empty key. The chart never creates the Secret.
  • Parent-chart global inheritance: global.labels, global.annotations, global.podLabels, global.podAnnotations, global.imagePullSecrets, global.nodeSelector, global.affinity, global.tolerations merge with local values (local wins). New commonLabels / commonAnnotations apply to every rendered object.
  • Resource tiers: global.resourceTier (small / medium / large presets, separate presets for server and the always-single-replica controller) plus resourceTierOverride to pin a tier locally. Empty tier keeps explicit resources.
  • global.customCA: inline certificate (chart renders a ConfigMap) or existingConfigMap.name; direct mount over /etc/ssl/certs or initContainer merge with the system bundle; sets NODE_EXTRA_CA_CERTS. New template custom-ca-configmap.yaml.
  • server.deploymentAnnotations / controller.deploymentAnnotations so a parent chart can set rollout ordering (e.g. Argo CD sync waves) per Deployment.
  • externalRedis.sentinel passthrough: injects REDIS_SENTINEL_HOSTS / REDIS_SENTINEL_MASTER_NAME / REDIS_SENTINEL_PASSWORD when set, so a Sentinel-backed install needs no chart change once the app reads them.
  • README documents the new values.

Test plan

  • helm lint passes
  • helm template default render (bundled Postgres/Redis) with apiKey set
  • env replace-in-place verified (POSTGRES_HOST override appears exactly once per container)
  • mTLS render: probes flip to HTTPS, cert mount present
  • global.customCA render: ConfigMap + initContainer merge + NODE_EXTRA_CA_CERTS
  • Sentinel render injects the three REDIS_SENTINEL_* vars
  • Empty apiKey fails template with a clear message
  • Publish charts/trueforge@0.1.6-rc.3 after merge (umbrella chart pins this version)

Note

Medium Risk
Touches env composition, controller→server URL scheme under mTLS, and pod init/volume behavior for custom CA—misconfiguration could break schedules, TLS, or outbound trust in umbrella deployments.

Overview
Bumps the Helm chart to 0.1.6-rc.3 and adds generic hooks so a parent chart (e.g. TrueFoundry control plane) can drive TrueForge without platform-specific values in this chart.

Configuration & auth: New apiKey maps to TRUEFORGE_API_KEY on server and controller (dev placeholder; validated non-empty). New env map applies to both workloads and replaces chart-computed vars by name (e.g. POSTGRES_HOST, PUBLIC_BASE_URL) instead of duplicating entries. externalRedis.sentinel optionally injects REDIS_SENTINEL_* env when external Redis is used.

Subchart / ops integration: Merges global.labels, annotations, pod labels/annotations, imagePullSecrets, scheduling (nodeSelector, affinity, tolerations append), and global.resourceTier with local overrides via commonLabels / commonAnnotations and resourceTier presets (small / medium / large) that replace explicit resources tables. global.customCA supports inline PEM (new ConfigMap template) or an existing ConfigMap, with direct mount or initContainer merge plus NODE_EXTRA_CA_CERTS. Deployment-level server.deploymentAnnotations / controller.deploymentAnnotations for rollout ordering.

Runtime wiring: Controller default SERVER_URL uses https when mtls.enabled. Resources and /tmp emptyDir size limits derive from tier helpers on both deployments. README and production checklist document the new values.

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

Prepare the chart to run as a dependency of a hosting platform's umbrella
chart while staying platform-neutral:

- env map (server + controller): scalar or valueFrom entries that replace
  chart-computed variables in place, the extension point for platform env
- apiKey value for TRUEFORGE_API_KEY (string or valueFrom); the chart fails
  fast on an empty key since the server always runs with STANDALONE=false
- inherit global.labels/annotations/podLabels/podAnnotations/
  imagePullSecrets/nodeSelector/affinity/tolerations from a parent chart,
  plus commonLabels/commonAnnotations on every rendered object
- resource tiers: global.resourceTier presets (small/medium/large) for the
  server and controller, resourceTierOverride to pin a tier locally
- global.customCA: rendered or existing ConfigMap, direct mount or
  initContainer merge into the system bundle, NODE_EXTRA_CA_CERTS
- server/controller deploymentAnnotations for parent-managed rollout
  ordering (e.g. Argo CD sync waves)
- externalRedis.sentinel passthrough (REDIS_SENTINEL_HOSTS/MASTER_NAME/
  PASSWORD) so a Sentinel install needs no chart change once the app reads
  them

Bump chart to 0.1.6-rc.3.

Signed-off-by: Raman Tehlan <ramantehlan@gmail.com>
@changeset-bot

changeset-bot Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 10196d1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@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 Bugbot comment from a previous run.

Comment thread charts/trueforge/templates/_helpers.tpl Resolved
Comment thread charts/trueforge/values.yaml Resolved
Comment thread charts/trueforge/values.yaml Resolved
Comment thread charts/trueforge/values.yaml Resolved
Comment thread charts/trueforge/values.yaml Resolved
Comment thread charts/trueforge/values.yaml Resolved
Comment thread charts/trueforge/README.md Resolved
Comment thread charts/trueforge/README.md Resolved
Comment thread charts/trueforge/README.md Resolved
Comment thread charts/trueforge/templates/_helpers.tpl Resolved

@chiragjn chiragjn left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Added minor comments, keeping it approved

- controller.serverUrl is a plain string again; the serverUrlEnv helper is
  gone. The computed in-cluster default is now scheme-aware (https when
  mtls is enabled).
- rename resourceTierOverride to resourceTier: tiers are a chart concept,
  not parent-specific. Precedence: resourceTier > global.resourceTier >
  explicit resources.
- apiKey ships a dev placeholder (placeholder-value-please-generate-your-own)
  so default installs render; replace it before any shared deployment.
- annotations (global.annotations + commonAnnotations) now land on Service,
  ServiceAccount, HPA, and PDB, not just the Deployments.
- drop parent-chart branding from comments and README; trim comment noise
  added by this branch.

Signed-off-by: Raman Tehlan <ramantehlan@gmail.com>
@ramantehlan
ramantehlan enabled auto-merge (squash) September 10, 2026 10:28
@ramantehlan
ramantehlan merged commit 92faed0 into main Sep 10, 2026
9 checks passed
@ramantehlan
ramantehlan deleted the sd/add-wire-truefoundry branch September 10, 2026 10:29

@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.

Reviewed by Cursor Bugbot for commit 10196d1. Configure here.

args:
- |
set -e
cat /etc/ssl/certs/ca-certificates.crt /custom-ca/ca-certificates.crt > /ssl-certs/ca-certificates.crt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Custom CA merge init fails

High Severity

The custom CA merge initContainer runs cat on /etc/ssl/certs/ca-certificates.crt inside the default tfy-mirror/alpine image. Vanilla Alpine does not ship the ca-certificates package, so that path is missing, set -e exits non-zero, and both Deployments stay stuck in init. This is the default path whenever global.customCA.enabled is true without existingConfigMap.overrideCAList.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 10196d1. Configure here.

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.

2 participants