feat(selfhost): chart-managed RDS CA (global.rdsCa), no bundle download or hash pins (agent-relay 0.7.85)
Self-hosted EKS installs on RDS no longer download the RDS CA bundle, create the rds-ca ConfigMap or paste its sha256 into the values. The Automation Anywhere sandbox rehearsal hit both failure modes: pods stuck in ContainerCreating with configmap "rds-ca" not found, and an example hash left on some lines so the TLS pin did not match.
What changes for operators
global:
rdsCa:
bundle: us-east-1 # the RDS region, or global
That one value replaces the rds-ca download, kubectl create configmap and the four hand-pinned hashes. examples/aws/values.yaml now uses it and drops every postgresCa / caConfigMap / caSha256 block.
Design
-
Owner: the
agent-relayumbrella. It ships AWS's public bundles infiles/rds-ca/(34 commercial regions plusglobal, fetched from truststore.pki.rds.amazonaws.com;manifest.yamlrecords URL, fetch date, bytes and sha256).templates/rds-ca.yamlrenders the ConfigMap (ca.crt, nameglobal.rdsCa.configMapName, defaultrds-ca) with.Files.Getand computessha256sumat render time. -
How the hash reaches the subcharts: through globals. A subchart cannot read the umbrella's files, so the umbrella's
values.yamlcarries a generated table,global.rdsCa.bundleSha256. The ConfigMap template fails if the bytes it renders do not hash to that table entry, so the mounted bytes and the pins cannot disagree. Each consuming chart has the same helper,templates/_rds-ca.tpl, synced fromci/rds-ca/_rds-ca.tplbyci/rds-ca/sync.sh. CI fails when a copy drifts. The helper computes the effective CA for:- relaycast
postgresCa(PostgreSQL backend only) and relay-controlpostgresCa; - in sessions-pipeline: the worker's
postgresCa(which feeds nativeBrief'sNATIVE_BRIEF_CA_SHA256), alleyoop'spostgresCa, the read API'spostgresCa(tlsProfile: custom-ca), thepostgresblocks of the ingest edge, search indexer and native consumer, andsessionAnalysis.postgresTls(custom-ca).
The native consumer's cross-chart equality checks compare these effective values.
- relaycast
-
Override (bring your own CA): a component that names another ConfigMap or a Secret keeps its own CA and hash, for a private CA or a database that is not RDS.
-
Fail loudly: with
global.rdsCaset, a component that namesrds-caor nothing gets the managed CA. The render fails on:- a hand-set hash that differs from the bundle's;
- a key other than
ca.crt; - an unknown or malformed bundle;
- a tampered
bundleSha256table; global.rdsCaon a subchart installed without the umbrella.
The all-zero placeholders in
values-eks-rds-native.yamlcount as unset, so that profile needs no hash override. Missing-hash errors in BYO mode now nameglobal.rdsCa.bundle. -
Backward compatible: with
global.rdsCa.bundleempty, which is the default, nothing changes. Values that setconfigMap: rds-caand explicit hashes render as before.examples/aws/values.yamlfrom origin/main renders byte-identical, thesubdomain-goldenhashes match without re-recording, and every chart'sci/*-values.yamlrender is unchanged. -
An
rds-cathe release does not own: an existingrds-cacreated by hand or byrds-setup.sh prefails the install, vialookup, withkubectl -n <ns> delete configmap rds-ca. I tested on kind with Helm 3.17 and 4.1: taking it over in place with Helm's ownership label and annotations does not work under Helm 4's server-side apply. kubectl keeps owning.data.ca.crt, so the first different bundle (for exampleglobalafter a regionalpre) conflicts. ClearingmanagedFieldsdid not help: the field then shows up asbefore-first-apply. Deleting the ConfigMap is safe: a running pod kept its mount, and the chart then owns the field alone. The ConfigMap carrieshelm.sh/resource-policy: keep, so turningglobal.rdsCaoff leaves it in place for BYO values. -
Scripts:
rds-setup.sh preuses the checkout's shipped bundle (curl only when run standalone) and never rewrites a chart-managedrds-ca.configure-rds.shdeletespre's copy when the values setglobal.rdsCa.bundle, and no longer prints a hash to paste.diagnose-install.pyreports a ConfigMap that a release pod mounts but nobody created, a chart-managedrds-cawhose bytes no longer match its pin, and an invalidglobal.rdsCa.bundle.
-
Rotation:
scripts/selfhost/refresh-rds-ca-bundles.sh(refresh,--check,--verify) plus a weeklyRDS CA bundlesworkflow. When AWS changes a bundle, the workflow fails and posts the refresh diff and a patch artifact.--verify(offline) runs in the lint job throughci/rds-ca/test.sh.
databaseGuard (#552)
The guard used to read each component's CA straight from the values. Under global.rdsCa those values are empty, so it now resolves each component's effective CA with the same _rds-ca.tpl rules (the umbrella has its own synced copy). Its pre-install hook runs before rds-ca exists, so the hook carries the managed bundle in its own ConfigMap. Renders without global.rdsCa, the guard included, are byte-identical to origin/main. The guard's kind test brings its own test CA, so it now layers ci/rds-ca/legacy-values.yaml; all 17 cases pass locally.
Review fixes
- Rolling restarts: Node workloads (relaycast, relay-control, worker, alleyoop) carry the pod annotation
agentworkforce.dev/rds-ca-sha256, so a new bundle rolls them. - Fixed name:
configMapNameis removed; the managed ConfigMap is alwaysrds-ca. - configure-rds.sh: it decides managed mode from the full
helm templaterender with every values file, with errors shown. It keeps anrds-cathis release already manages and refuses one that another release owns. - Disabled blocks: a disabled block keeps its values untouched.
- rds-setup.sh saves
ca.crtbyte for byte. - diagnose-install.py ignores optional mounts.
Size (Helm release Secret, 1 MiB limit)
Only the umbrella's own files go into the release. Subcharts are not serialized there, because Chart.dependencies is unexported in Helm's JSON. Estimated with ci/rds-ca/release-size.py, which mirrors Helm's base64(gzip(json)) encoding:
| release Secret | |
|---|---|
| origin/main (with #552), EKS example | 185,480 B (0.18 MiB) |
this PR, EKS example, us-east-1 | 490,860 B (0.47 MiB) |
this PR, global (175 KB bundle rendered in rds-ca and the databaseGuard hook) | 707,436 B (0.67 MiB) |
Shipping all regions fits, so the chart ships them all. self-hosted/requirements.yaml lists no regions to narrow to, and .Files.Get would not shrink the release anyway, because every chart file is stored. ci/rds-ca/test.sh fails above 0.9 MiB.
Tests
-
ci/rds-ca/test.sh(new, in Lint) runs 57 checks (including databaseGuard's hook CA, the restart annotations and a disabled component):- default off;
- region: the ConfigMap bytes equal the shipped file, and every workload mounts
rds-caand pins the same hash (read API, ingest edge, search indexer and its bootstrap Job, nativeBrief), withNODE_EXTRA_CA_CERTSon relaycast, relay-control and worker; global; a renamed ConfigMap;- override: a private ConfigMap or a Secret source is kept; a matching hand-set hash and the zero placeholder are accepted;
- 11 failure cases;
- legacy values (
ci/rds-ca/legacy-values.yaml) and theeks-rds-nativeprofile with site values render unchanged; legacy values whose hash matches the bundle work underglobal.rdsCa; - helper sync, bundle/manifest/table agreement, release size.
-
scripts/selfhost/tests/rds-setup-test.sh: two new cases (shipped bundle used; a chart-managedrds-cais left alone).scripts/support/tests: two new cases (39 tests). -
I ran Lint's suites in a Linux container (helm v4.3.1, the CI version) on this branch and on origin/main. Both trees give the same results:
- pass on both: selfhost tests, registry and its regression tests, subdomain golden,
render.sh,rds-ca. charts.sh staticfails on both with the same single error (relaychief-control: the server must run the image default command).matrix.sh staticfails on both with the same twoHOOPDB_DB_MODEerrors.
I believe these two come from the container's yq version and say nothing about this branch; CI will show.
- pass on both: selfhost tests, registry and its regression tests, subdomain golden,
-
version-bump.shpasses. The lock files change only in the bumped file:// versions, the digest and the generated time.
Charts: agent-relay 0.7.85 (#552 took 0.7.84), relaycast 0.3.18, relay-control 0.4.27, sessions-pipeline 0.8.61, sessions-pipeline-worker 0.7.16, session-ingest-api 0.4.6, session-read-api 0.2.18. Rebased on #551, #552, #555, #557 and #558.
Follow-up: configure-rds.sh downloads rds-setup.sh pinned to the 2026.11.18 tag. That older copy still re-applies rds-ca. Until the pin moves to a release with this change, configure-rds.sh deletes that copy itself in managed mode. Docs PR: AgentWorkforce/agentrelay.com#340 (it depends on this PR and on a release that includes it).
🤖 Generated with Claude Code