Skip to content

feat(helm): the Postgres connection string from a Secret (kagent-dev/substrate#32) and atelet scheduling knobs - #8

Merged
teemow merged 4 commits into
giantswarmfrom
fork/postgres-secret-and-atelet-scheduling
Sep 11, 2026
Merged

teemow merged 4 commits into
giantswarmfrom
fork/postgres-secret-and-atelet-scheduling

Conversation

@teemow

@teemow teemow commented Sep 11, 2026

Copy link
Copy Markdown
Member

Problem

Meta chart 4.0 ships Substrate inside the agent-platform chart (components.substrate / components.substrate-crds). Two things the Substrate chart cannot express today:

  • The connection string of an external PostgreSQL only as a value. The platform puts Substrate's control-plane database on its CNPG cluster, which hands out the DSN in a Secret. The chart takes postgres.connectionString as a plain value and writes it into the ate-api-server-envvars ConfigMap — credentials in a ConfigMap, and a Secret that has to be copied into values first.
  • No scheduling knob on atelet. The platform runs atelet on its worker nodes / node pools; the atelet DaemonSet renders no nodeSelector, tolerations or affinity.

Solution — upstream first

  1. git cherry-pick -x of Support PostgreSQL connection secrets kagent-dev/substrate#32 "Support PostgreSQL connection secrets" (open, by iplay88keys) — both commits of the pull-request branch, unchanged, with the upstream author and the (cherry picked from commit …) trailers:
    • 1872249e42c0c6b8: postgres.connectionStringSecretRef.{enabled,name,key}; the substrate.postgres.connectionStringSecretEnabled helper; two guards (connectionString and connectionStringSecretRef are mutually exclusive; one of them is required when postgres.enabled=false); ate-api-server reads ATE_API_POSTGRES_CONNECTION_STRING from a secretKeyRef (defaults <release>-postgres-connection / connectionString) and the ConfigMap omits it in Secret mode; README row; charts/substrate/tests/postgres_test.yaml; the helm-test Makefile target and the helm-e2e step that runs helm-unittest.
    • 41097da7392841e2: helm plugin install … --verify=false in that step — without it the helm-e2e job fails on Helm 4 (the reason the upstream PR carries the follow-up).
      Every hunk applied cleanly; nothing was dropped. The patch falls away at the re-pin onto the first upstream release that carries it.
  2. One commit of ours, upstream-ready (d9717d78): feat(helm): atelet DaemonSet takes nodeSelector, tolerations and affinityatelet.nodeSelector: {}, atelet.tolerations: [], atelet.affinity: {}, rendered in the DaemonSet pod spec next to serviceAccountName; README rows; charts/substrate/tests/atelet_test.yaml. Upstream has no focused change for this: Add configurable nodeSelector to substrate workloads kagent-dev/substrate#16 adds atelet.nodeSelector (no tolerations or affinity) inside a 92-file fork-wide pull request that has been conflicting since July; ours is the minimal knob. The upstream-shaped patch is branch upstream/atelet-scheduling in this repository (b34c1690, on the mirror main, default render identical there too); it is opened against kagent-dev/substrate after review in giantswarm/giantswarm#37742, not before.
  3. Ledger: the last commit adds the two rows to the "Carried patches" table of FORK.md and points the meta-chart consumer row at 4.0.

Verification

  • Default render (helm template s charts/substrate) byte-identical before and after each patch; make verify-helm-template passes (manifests/ate-install/ unchanged).
  • Secret mode: helm template s charts/substrate --set postgres.enabled=false --set postgres.connectionStringSecretRef.name=x --set postgres.connectionStringSecretRef.key=uri renders the ate-api-server env ATE_API_POSTGRES_CONNECTION_STRING from secretKeyRef {name: x, key: uri} and a ConfigMap that carries only ATE_API_POSTGRES_SCHEMA.
  • helm unittest charts/substrate (helm-unittest 1.0.3, Helm 4.2.2): 2 suites, 11 tests pass; hack/util/verify-boilerplate.py and helm lint clean.
  • CI on this PR: run-tests, govulncheck, helm-e2e (which now runs make helm-test as well).

Merge

Rebase-merge (gh pr merge --rebase): the commits land as they are — the two cherry-picks keep their trailers so the next re-pin drops them by itself, and the atelet commit is the one upstream gets.

Refs giantswarm/agent-platform#342

iplay88keys and others added 4 commits September 11, 2026 04:08
Allow ate-api-server to read an external PostgreSQL connection string from a Secret while keeping schema configuration in the existing ConfigMap. Add Helm unit coverage for bundled, literal, Secret-backed, and invalid setups.

(cherry picked from commit 1872249)
(cherry picked from commit 41097da)
…nity

The atelet DaemonSet had no scheduling knob: it ran on every schedulable
node. Clusters that keep sandboxes on a worker node pool need to pin it.
Add atelet.nodeSelector, atelet.tolerations and atelet.affinity; empty
by default, so the rendered manifests do not change. Helm unit coverage
for the default and the configured cases.
@teemow
teemow force-pushed the fork/postgres-secret-and-atelet-scheduling branch from f91b58e to 4370d97 Compare September 11, 2026 02:08
@teemow
teemow merged commit ef30433 into giantswarm Sep 11, 2026
4 checks passed
@teemow
teemow deleted the fork/postgres-secret-and-atelet-scheduling branch September 11, 2026 02:28
teemow added a commit that referenced this pull request Sep 11, 2026
…ests; the #8 patches' commits as they are on giantswarm (#11)

The second release of the line, v0.0.27-gs.2 (tag on ef30433 = gs.1 + the
Postgres connection Secret cherry-picks of kagent-dev#32 and the
atelet scheduling knobs, #8), published by run 34554981306 with every scan
clean, gets its ledger row: index digests of the six images, the two chart
digests, the dataplane it runs.

The carried-patches table named the #8 commits by their pull-request
branch SHAs (42c0c6b, 392841e, d9717d7), which the rebase merge rewrote;
the commits on giantswarm are c1e4e32, f06f5ef and 084d916.
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