Skip to content

Support PostgreSQL connection secrets - #32

Draft
iplay88keys wants to merge 19 commits into
mainfrom
iplay88keys/postgres-connection-secret
Draft

iplay88keys wants to merge 19 commits into
mainfrom
iplay88keys/postgres-connection-secret

Conversation

@iplay88keys

@iplay88keys iplay88keys commented Sep 4, 2026

Copy link
Copy Markdown

Important

This PR requires a substrate bump after this upstream PR merges: agent-substrate#1752

Summary

  • Add postgres.connectionStringSecretRef so the chart can read the Substrate runtime/DML connection from a Kubernetes Secret instead of placing credentials in a ConfigMap.
  • Add optional postgres.ddlConnectionString and postgres.ddlConnectionStringSecretRef settings for a separate schema-owner connection used by migrations and maintenance.
  • Pass the DDL connection to ateapi through ATE_API_POSTGRES_DDL_CONNECTION_STRING and --postgres-ddl-connection-string=@env.
  • Keep postgres.schema in the existing ConfigMap and default enabled Secret references without a name to the release-scoped <release>-postgres-connection Secret.
  • Reject conflicting inline and Secret-backed settings, a missing external runtime connection, and a DDL connection without an explicit runtime connection.
  • Add Helm unit coverage and run the chart tests in the existing Helm CI workflow.

This lets parent charts provide PostgreSQL credentials through normal Kubernetes Secret references without coupling Substrate to a specific parent chart.

Configuration

The existing single-connection configuration remains supported:

postgres:
  enabled: false
  schema: substrate
  connectionStringSecretRef:
    name: substrate-postgres
    key: connectionString

For separate runtime/DML and DDL roles, both connections can come from the same Secret under different keys:

postgres:
  enabled: false
  schema: substrate
  connectionStringSecretRef:
    name: substrate-postgres
    key: runtimeConnectionString
  ddlConnectionStringSecretRef:
    name: substrate-postgres
    key: ddlConnectionString

When the DDL connection is omitted, ateapi uses the runtime connection for both purposes. With separate roles, the DDL role owns the schema and creates its objects; after migrations, ateapi grants the runtime role the table and sequence permissions it needs. This avoids requiring operators to update grants whenever a migration adds a table.

@iplay88keys
iplay88keys marked this pull request as draft September 4, 2026 19:48
@iplay88keys
iplay88keys marked this pull request as ready for review September 4, 2026 20:24
@iplay88keys
iplay88keys requested a review from EItanya September 4, 2026 21:52
@EItanya
EItanya force-pushed the main branch 3 times, most recently from 971d345 to 007eb1e Compare September 10, 2026 21:46
teemow added a commit to giantswarm/substrate that referenced this pull request Sep 11, 2026
teemow added a commit to giantswarm/substrate that referenced this pull request Sep 11, 2026
teemow added a commit to giantswarm/substrate that referenced this pull request Sep 11, 2026
teemow added a commit to giantswarm/substrate that referenced this pull request Sep 11, 2026
teemow added a commit to giantswarm/substrate 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.
@EItanya
EItanya force-pushed the main branch 4 times, most recently from ac24963 to f60e0f3 Compare September 16, 2026 16:16
EItanya and others added 10 commits September 17, 2026 10:57
Build and publish versioned binaries, container images, and Helm charts from release tags.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Resolve atelet discovery and identity from the pod namespace, centralize install defaults, and allow explicitly selected local clusters to run without Pod Certificates. Keep authenticated transport as the default.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Add a configurable end-to-end workflow deadline and propagate it through lease acquisition. Apply released worker assignments to the cache immediately so subsequent scheduling sees the completed pause.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Parse PKCS1 RSA and SEC1 EC keys alongside PKCS8 keys, including regression coverage for RSA bundles.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Require the agentgateway E2E lane, reuse the installed control plane for microVM demos, wait for asset storage initialization, and accommodate runtime startup and counter persistence behavior in E2E checks.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Package the control plane, workers, PostgreSQL, RustFS, and CRDs as Helm charts. Keep manifests and generated RBAC aligned, add Helm E2E checks, and include current scheduling, sandbox permissions, and agentgateway configuration.

Co-authored-by: Jet Chiang <jetjiang.ez@gmail.com>
Co-authored-by: Keith Mattix II <keithmattix2@gmail.com>
Signed-off-by: Jet Chiang <pokyuen.jetchiang-ext@solo.io>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Allow an external PostgreSQL instance and a configurable schema, validate connection settings, and pass the schema to the API server.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Wire the API server snapshot backend and S3 settings to the chart storage configuration.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Configure trace, metric, and log endpoints independently, expose trace sampling, and route agentgateway access logs through the collector logs pipeline.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Isolate sandbox asset download tests from pause image pulls, explicitly advance the CA file timestamp, and disable VCS stamping for license checks in temporary verification worktrees.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Delete application containers before the pause container so their shared sandbox remains available throughout teardown. Cover the deletion order with a regression test.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Rebuild the fork on upstream while preserving features, require agentgateway runtime validation, and use a guarded push. Delete task-owned clusters and disposable assets before finishing while preserving shared resources and recovery data.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Select agentgateway expectations in the Helm test job, align the chart sandbox assets with the canonical manifest, and enable the CONNECT tunnel logging used by egress validation. This retains upstream gVisor checkpoint and restore fixes and closes configuration gaps between Helm and manifest installations.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Expose ateApi.extraArgs so installations can configure API flags such as the template resync interval without editing the deployment template.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
A layer pull can share a singleflight call with retirement and return without unpacking the removed layer. Distinguish pull results from retirement results and retry after retirement completes. Cover the interleaving with a deterministic concurrency test.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
The egress ext_proc server listens on loopback. Probe the metrics readiness endpoint so Kubernetes can observe readiness through the pod IP, matching the upstream manifests.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
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.
@iplay88keys
iplay88keys force-pushed the iplay88keys/postgres-connection-secret branch from 41097da to 38af2c9 Compare September 17, 2026 17:23
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