feat(agent-relay): helm test install status, search bootstrap causes, guided configure-rds.sh (agent-relay 0.7.87, sessions-pipeline 0.8.62)
Follows #552 (databaseGuard, merged): it reuses files/db-guard/lib.mjs. Rebased on main.
What a customer sees
helm test agent-relay -n agent-relay --logs
Real output from the kind test. The install has real images against an RDS-shaped test DB, and the migrations were still running:
POD LOGS: agent-relay-status
Agent Relay install status (release agent-relay, namespace agent-relay)
AREA CHECK STATUS DETAIL
migrations relay-control-migrate FAIL not complete yet (running or pending); rerun helm test when it finishes
migrations relaycast-migrate FAIL not complete yet (running or pending); rerun helm test when it finishes
workloads relay-control FAIL 0/1 ready
database agent-relay-secrets: database-url ok login=control_api_runtime: dedicated service login
database agent-relay-secrets: database-owner-url ok login=relaycast_owner: relaycast owner identity
... (10 database rows, all ok)
ca configMap/rds-ca FAIL sha256 7bec69... differs from the configured 9f2c4e1a...: update every caSha256/sha256 for rds-ca in values
pod identity serviceaccount/agent-relay-worker FAIL no EKS Pod Identity association (or IRSA role) for this ServiceAccount: aws eks create-pod-identity-association --namespace agent-relay --service-account agent-relay-worker ...
s3 example-agent-relay-sessions FAIL bucket not found in us-east-1
search vpc-agent-relay-example.us-east-1.es.amazonaws.com FAIL cannot reach vpc-agent-relay-example.us-east-1.es.amazonaws.com (ENOTFOUND): check the OpenSearch security group and VPC access
UNHEALTHY: 20 check(s) failed
NOTES now prints the command after every install and upgrade.
Design
- One status Pod,
<release>-status, is the only test hook. It runs in the relaycast image the release already pins and reuses the databaseGuard lib, so the database rows apply the same rules as install-time: verify-full TLS with each component's own CA, and relaycast'sverifyIdentity. Its ServiceAccount and script ConfigMap are ordinary release objects. I tried them as test hooks first, but then Helm 4 treated each one as a suite and--logsprinted the table five times. - Kubernetes rows need a Role. The migrations, workloads and pod identity rows read the API through a read-only Role (list jobs, deployments and pods; never secrets). That Role sits behind
databaseGuard.statusTest.rbac.createand is off by default. Today's EKS render creates no RBAC objects, and the namespace-scoped operator Role indocs/selfhost-secret-access.mdcannot create Roles, so turning it on by default would break those operators' installs (the same issue as the #552 review finding). With the Role off, those rows showskipwith the exactkubectlcommand to run instead. The guided installer in part D will turn the Role on. - S3 and OpenSearch checks are network-only. They make unauthenticated HTTPS requests: a 404 means the bucket is missing, a 301 means it's in the wrong region, and any other HTTP answer means it's reachable. Credentials are covered by the pod identity row.
Addendum from the live rehearsal (search bootstrap)
After configure-rds.sh --reset-databases in the rehearsal, the search-indexer-bootstrap Job ran before rds-setup.sh post and failed with only timed out waiting for the condition. The search indexer then crash-looped on permission denied for schema sessions. A plain helm rerun never retried the Job, because it keeps its name, and the diagnostic reported no failures. This PR now covers that:
- Status rows: in the status table, the HoopDb runtime, read API, ingest and search runtime logins must have USAGE on
sessionsonce that schema exists. A login without it fails its row, and the row gives the fix:run rds-setup.sh post (configure-rds.sh does it), then delete the failed search-indexer-bootstrap Job and run helm upgrade again. A failedsearch-indexer-bootstrapJob row names the same fix. This check runs only in the status test, not in the install hook: beforepostthis state is expected, so the hook mustn't block on it. - Bootstrap guard (sessions-pipeline 0.8.61): the guard's wait timeout now names what it was waiting for and the fix:
timed out after <n>s waiting for search_consumer_runtime to become a LOGIN role ... Fix: run rds-setup.sh post ..., then delete this search-indexer-bootstrap Job ... and run helm upgrade again. A final failure that shows an unactivated search login (permission denied, NOLOGIN, or a password or role failure) logs the same fix. Two new guard tests, 8/8 passing. The umbrella's sessions-pipeline dependency andChart.lockchange only that version and the lock digest. The fix that reorders the bootstrap itself (re-running it afterpost) is in the guided-install PR. - Goldens: I updated the subdomain goldens with Helm v4.3.1. The only diffs are the bootstrap-guard ConfigMap (new content, so a new hash name) and the status ServiceAccount and ConfigMap in the two renders where relaycast runs on PostgreSQL.
Tests
ci/agent-relay/db-guard/kind.sh(thedb-guard-kindjob): 18/18 pass. The new case installs withrbac.create=trueand asserts:- 9 login rows are ok, and the search runtime row FAILs with the fix when
sessionsexists without its USAGE - the CA sha mismatch is reported
- each migration Job gets its own row
- there is exactly one test Pod and a verdict line
- no URL appears in the output
- the default render has no Role or RoleBinding
- 9 login rows are ok, and the search runtime row FAILs with the fix when
scripts/ci/charts.sh static agent-relay,ci/agent-relay/render.sh, allci/agent-relay/test_*.py,ci/agent-relay/kind/test_local_stack.pyand the registry check all pass. The fast-path workflow is regenerated (no change).
🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Summary by cubic
Makes helm test agent-relay -n <namespace> --logs print a single healthy/unhealthy install status table for self-hosted Agent Relay, and makes scripts/selfhost/configure-rds.sh the guided install path that runs that check (agent-relay 0.7.86, sessions-pipeline 0.8.62).
Install status
- The status Pod runs in the pinned relaycast image and reuses the databaseGuard lib, so database rows apply the same verify-full TLS and verifyIdentity rules as install-time. Only the Pod is a test hook; its ServiceAccount, ConfigMap and optional Role are ordinary release objects, so
--logsprints the table once. - Each row is
ok,FAIL(the fix is in the detail), orskip, and anyFAILexits non-zero. A search login missing USAGE onsessionsand a failedsearch-indexer-bootstrapJob both fail their rows with the fix, without blocking installs. - Migration, workload and pod-identity rows read the Kubernetes API through a read-only Role behind
databaseGuard.statusTest.rbac.create, off by default; without it theyskipwith the exactkubectlcommand. S3 and OpenSearch checks are unauthenticated network probes only, and no URL, password or Secret value is printed. - A Deployment row is
okonly when replicas equal updatedReplicas, so a stuck old-revision rollout fails; an unbuildable URL becomes aFAILrow instead of aborting the table; CA pins come only from components that actually run.
Guided install and guards
configure-rds.shis now the primary EKS + RDS install path: it creates the logins, writes the five Secrets, pins the CA and image digests, editsvalues.yamlin place (so a later plain helm upgrade keeps the layout), runs helm, waits on Jobs, and ends with thehelm testverdict. Job waits stop at Complete or Failed, and a failed search bootstrap is deleted and re-run afterpost.--reset-databaseschecks ownership before dropping anything. Hand-written Secrets are the bring-your-own option and are refused up front when they fail databaseGuard.- The search bootstrap guard (sessions-pipeline 0.8.62) now names what it waited for and the fix: an unactivated login points at
rds-setup.sh post, an unreachable OpenSearch names the host and likely cause, missing credentials point at Pod Identity, and a 403 names the role mapping. The one-line cause is written to the Pod termination message. - databaseGuard now refuses a plain helm upgrade that drops
rdsLayoutwhile a dedicated HoopDb owner login is set, pointing atrdsLayout: separate-database; without it the HoopDb migrate Job failed withrds_profile_unproven. - The search indexer's startup hint now reads its namespace from a new
POD_NAMESPACEenv var, so thekubectlcommand it prints is correct. diagnose-install.pyends with a RESULT line, and skipped workload checks report INCOMPLETE (exit 3).