Repository navigation
feat(selfhost): configure-rds.sh is the guided, primary EKS + RDS install path - #556
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
There was a problem hiding this comment.
Devin Review found 4 potential issues.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
| SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)" | ||
| CHECKOUT=0; [[ "$RELEASE_VERSION" == checkout ]] && CHECKOUT=1 | ||
| STATUS_RBAC="${STATUS_RBAC:-1}" |
There was a problem hiding this comment.
🔴 Default release blocks checkout installs
The guided install command passes the checkout chart, but RELEASE_VERSION defaults to an older release and rejects it. Switching to the pinned chart avoids the rejection but leaves helm test without the advertised status hook.
Learn more
The guided install command uses a local chart path without setting RELEASE_VERSION. The installer defaults to release 2026.11.18 and compares the chart version with that release’s chart before provisioning. That release ships chart 0.7.63 without the database guard or status test; the current checkout chart is 0.7.85 and includes them.
Example: Use the quickstart against the current checkout. The script rejects 0.7.85 because it expects 0.7.63. Point it at 0.7.63 instead, and the status stage cannot print the new table even when the installation succeeds.
Recommended fix: Make the checkout quickstart explicitly select RELEASE_VERSION=checkout. For the pinned path, select a release that ships the required hooks or explicitly handle and document the older release’s lack of status support. Test the documented invocation as well as the checkout override.
Was this helpful? React with 👍 or 👎 to provide feedback.
| failed_boot="$(k get jobs -o json | jq -r '.items[] | select(.metadata.name | test("search-indexer-bootstrap")) | select((.status.succeeded // 0) == 0) | .metadata.name')" | ||
| if [[ -n "$failed_boot" && -n "${HELM_CHART:-}" ]]; then | ||
| for j in $failed_boot; do k delete job "$j" >/dev/null && info "deleted $j to rerun it"; done | ||
| helm_upgrade >/dev/null || die "helm upgrade (search bootstrap rerun) failed" | ||
| boot="$(k get jobs -o name | grep search-indexer-bootstrap | head -n1)" |
There was a problem hiding this comment.
🔴 Search repair deletes other releases’ jobs
With another search release in the namespace, failed_boot includes its running or failed bootstrap jobs. The installer deletes them but upgrades only the selected release, leaving the other release’s jobs missing.
Learn more
The search bootstrap Job template labels the Job with both its Helm release and its bootstrap component. It also includes a hash in the Job name so changed inputs create a different Job. The installer does not use either label when deleting a Job, and it chooses the first matching name in the namespace when waiting for the rerun. The Helm upgrade manages only the selected release.
Example: Run the installer for agent-relay in a namespace where analytics-search-indexer-bootstrap-1234abcd is still running. The installer deletes the analytics Job and upgrades agent-relay; the analytics Job is not recreated.
Recommended fix: Identify the selected release’s current bootstrap Job using the release manifest or both release and component labels. Confirm its terminal failure before deleting it, and wait for that exact Job after the upgrade. Leave active and unrelated Jobs untouched.
Was this helpful? React with 👍 or 👎 to provide feedback.
| for key in "${APP_KEYS[@]}"; do | ||
| f="$FILES/agent-relay-secrets/$key" | ||
| if secret_has agent-relay-secrets "$key"; then rm -f "$f"; continue; fi # keep the cluster's value |
There was a problem hiding this comment.
🔴 Reruns erase saved encryption keys
On a routine rerun, secret_has triggers deletion of the local encryption keys when they also exist in Kubernetes. After losing the cluster Secret, an operator cannot recover those keys from the installer’s credential directory.
Learn more
The installer writes selfhost-encryption-key and SUMMARY_MASTER_KEYS to the private credential directory and tells the operator to back up those files. A second run preserves the deployed keys by removing them from the local directory before building the Secret patch. That removes the recovery copies even though the cluster values did not change.
Example: Complete an install, ingest data, and run the recommended retry. The Kubernetes Secret still contains the original keys, but their saved files are gone. Restoring the database without the Kubernetes Secret or an independent backup then leaves encrypted data unreadable.
Recommended fix: Keep the key files separate from the patch inputs. Omit application keys already present in Kubernetes when building the patch rather than deleting their files. If local files are meant to mirror the deployed values, update them privately and atomically from the authoritative Secret.
Was this helpful? React with 👍 or 👎 to provide feedback.
| k rollout status "deployment/$SVC" --timeout=600s >/dev/null 2>&1 || info "relay-control is not rolled out yet; trying anyway" | ||
| for attempt in 1 2 3 4 5 6; do | ||
| k port-forward "svc/$SVC" 18787:"$PORT" >/dev/null 2>&1 & PF=$! | ||
| for _ in $(seq 1 20); do | ||
| curl -s -o /dev/null --max-time 2 http://127.0.0.1:18787/ 2>/dev/null && break | ||
| kill -0 "$PF" 2>/dev/null || break | ||
| sleep 1 | ||
| done | ||
| code="$(curl -sS -o "$WORK/setup-key.json" -w '%{http_code}' -X POST -H "Authorization: Bearer $TOKEN" \ | ||
| http://127.0.0.1:18787/api/v1/installation/setup-key 2>/dev/null || true)" |
There was a problem hiding this comment.
🟥 Bootstrap token sent to unverified listener
The first sign-in retry trusts any HTTP response on port 18787 without confirming that kubectl port-forward owns it. A local user on a shared installer host can receive the bootstrap token, even when the deployment never became ready.
Was this helpful? React with 👍 or 👎 to provide feedback.
[Critical impact] The PR changes the operator-run EKS and RDS install path, including writes to Kubernetes Secrets and database setup. Do not merge yet: reruns can lose saved encryption keys or replace live ones, and the installer can delete another release's bootstrap Jobs.
|
| generated=0 | ||
| for key in "${APP_KEYS[@]}"; do | ||
| f="$FILES/agent-relay-secrets/$key" | ||
| if secret_has agent-relay-secrets "$key"; then rm -f "$f"; continue; fi # keep the cluster's value |
There was a problem hiding this comment.
Reruns delete saved encryption keys
A normal rerun deletes the saved application keys whenever they already exist in Kubernetes. This includes selfhost-encryption-key and SUMMARY_MASTER_KEYS, which the first run tells the operator to back up. Losing the Kubernetes Secret afterward would leave no local recovery copy. Keep these files; if the cluster holds a different value, save that value privately before proceeding.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/configure-rds.sh
Line: 279
Comment:
**Reruns delete saved encryption keys**
A normal rerun deletes the saved application keys whenever they already exist in Kubernetes. This includes `selfhost-encryption-key` and `SUMMARY_MASTER_KEYS`, which the first run tells the operator to back up. Losing the Kubernetes Secret afterward would leave no local recovery copy. Keep these files; if the cluster holds a different value, save that value privately before proceeding.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| secret_has() { # secret key | ||
| [[ -n "$(k get secret "$1" -o jsonpath="{.data.${2//./\\.}}" 2>/dev/null)" ]] | ||
| } |
There was a problem hiding this comment.
secret_has treats a failed Kubernetes read as a missing key. If a read times out and the local key file is absent, the loop generates a replacement. When the later patch succeeds, it overwrites the existing cluster key. For the encryption keys, this makes existing data unreadable. Require a successful Secret read before generating anything, and distinguish a missing key from a failed request.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/configure-rds.sh
Line: 272-274
Comment:
**Failed reads can replace keys**
`secret_has` treats a failed Kubernetes read as a missing key. If a read times out and the local key file is absent, the loop generates a replacement. When the later patch succeeds, it overwrites the existing cluster key. For the encryption keys, this makes existing data unreadable. Require a successful Secret read before generating anything, and distinguish a missing key from a failed request.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| case "$STATUS_VERDICT:${DIAG_RC:-none}" in | ||
| HEALTHY:0|HEALTHY:none) info "HEALTHY: every install check passed." ;; | ||
| HEALTHY:3|*:3) info "INCOMPLETE: the support diagnostic could not reach the cluster, so its workload checks were skipped." ;; | ||
| UNHEALTHY:*) info "UNHEALTHY: the status table above lists each FAIL with its fix." ;; | ||
| *) info "INCOMPLETE: the status test did not report (see above)." ;; |
There was a problem hiding this comment.
Healthy installs end as incomplete
With the diagnostic beside this script, even a healthy install ends as INCOMPLETE. The installer passes --scope cluster, which always adds a database UNKNOWN because database checks were not requested. The diagnostic therefore returns 2, and HEALTHY:2 falls through to “the status test did not report” despite a healthy table. Exclude deliberately unrequested checks from the unknown count, or handle this result explicitly.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/configure-rds.sh
Line: 503-507
Comment:
**Healthy installs end as incomplete**
With the diagnostic beside this script, even a healthy install ends as `INCOMPLETE`. The installer passes `--scope cluster`, which always adds a database `UNKNOWN` because database checks were not requested. The diagnostic therefore returns `2`, and `HEALTHY:2` falls through to “the status test did not report” despite a healthy table. Exclude deliberately unrequested checks from the unknown count, or handle this result explicitly.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| failed_boot="$(k get jobs -o json | jq -r '.items[] | select(.metadata.name | test("search-indexer-bootstrap")) | select((.status.succeeded // 0) == 0) | .metadata.name')" | ||
| if [[ -n "$failed_boot" && -n "${HELM_CHART:-}" ]]; then | ||
| for j in $failed_boot; do k delete job "$j" >/dev/null && info "deleted $j to rerun it"; done |
There was a problem hiding this comment.
Cleanup deletes other releases' Jobs
If another release has a running or failed search bootstrap in this namespace, this cleanup deletes it too. It matches every unfinished Job whose name contains search-indexer-bootstrap, while helm_upgrade only recreates resources for $RELEASE. The other release is left without its bootstrap Job. Filter by the release and component labels, and use that same filtered set when choosing the Job to wait for.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/configure-rds.sh
Line: 409-411
Comment:
**Cleanup deletes other releases' Jobs**
If another release has a running or failed search bootstrap in this namespace, this cleanup deletes it too. It matches every unfinished Job whose name contains `search-indexer-bootstrap`, while `helm_upgrade` only recreates resources for `$RELEASE`. The other release is left without its bootstrap Job. Filter by the release and component labels, and use that same filtered set when choosing the Job to wait for.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| check "helm test: every database login ok" '! grep -E "^ database " configure-rds.log | grep -qv " ok "' | ||
| check "helm test: every migration Job ok" '! grep -E "^ migrations " configure-rds.log | grep -qv " ok "' | ||
| check "a plain verdict and Next steps end the run" 'grep -qE "^ (HEALTHY|UNHEALTHY|INCOMPLETE): " configure-rds.log && grep -q "^ Next:" configure-rds.log' | ||
| check "the guide generated the application keys" 'k get secret agent-relay-secrets -o jsonpath="{.data.selfhost-encryption-key}" | grep -q .' |
There was a problem hiding this comment.
Existing keys bypass generation coverage
This assertion does not test key generation. 02-customer-state.sh applies example Secrets containing every application key, and this check only verifies that selfhost-encryption-key exists afterward. It would pass if the entire generation block were removed. Add a fresh-install case with missing application keys, then assert that they are generated and remain unchanged on a second run.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/tests/configure-rds-e2e/04-verify.sh
Line: 40
Comment:
**Existing keys bypass generation coverage**
This assertion does not test key generation. `02-customer-state.sh` applies example Secrets containing every application key, and this check only verifies that `selfhost-encryption-key` exists afterward. It would pass if the entire generation block were removed. Add a fresh-install case with missing application keys, then assert that they are generated and remain unchanged on a second run.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
| # the time is up. (kubectl wait --for=condition=complete keeps waiting on a | ||
| # failed Job until its timeout, then says only "timed out waiting for the condition".) | ||
| wait_job() { | ||
| local job="${1#job/}" deadline=$((SECONDS + $2)) state |
There was a problem hiding this comment.
Finished bootstrap looks unfinished
When the search bootstrap is rerun, kubectl get jobs -o name returns job.batch/<name>. wait_job strips only job/, then calls kubectl get job job.batch/<name>, which rejects the mixed argument forms. Each poll fails silently, so the installer waits ten minutes and says the bootstrap did not complete even when it succeeded.
Strip everything before the slash, or pass the full resource name without a separate job argument.
| local job="${1#job/}" deadline=$((SECONDS + $2)) state | |
| local job="${1##*/}" deadline=$((SECONDS + $2)) state |
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/configure-rds.sh
Line: 113
Comment:
**Finished bootstrap looks unfinished**
When the search bootstrap is rerun, `kubectl get jobs -o name` returns `job.batch/<name>`. `wait_job` strips only `job/`, then calls `kubectl get job job.batch/<name>`, which rejects the mixed argument forms. Each poll fails silently, so the installer waits ten minutes and says the bootstrap did not complete even when it succeeded.
Strip everything before the slash, or pass the full resource name without a separate `job` argument.
```suggestion
local job="${1##*/}" deadline=$((SECONDS + $2)) state
```
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.7536abd to
8238095
Compare
| import json, os, re, sys | ||
| path = sys.argv[1] | ||
| lines = open(path).read().split("\n") | ||
| KEY = lambda k: re.compile(r"^(\s*)" + re.escape(k) + r"\s*:(\s|$)") |
There was a problem hiding this comment.
If values.yaml uses a quoted top-level key such as "sessions-pipeline":, KEY does not recognize it. The editor appends another sessions-pipeline block containing only the new settings and reports success. Helm then reads that later block instead of the customer's original block, losing database, storage and service settings.
Use a YAML-aware edit, or reject quoted keys and use the existing overlay fallback.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/configure-rds.sh
Line: 371
Comment:
**Quoted settings get replaced**
If `values.yaml` uses a quoted top-level key such as `"sessions-pipeline":`, `KEY` does not recognize it. The editor appends another `sessions-pipeline` block containing only the new settings and reports success. Helm then reads that later block instead of the customer's original block, losing database, storage and service settings.
Use a YAML-aware edit, or reject quoted keys and use the existing overlay fallback.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| import os, re, sys | ||
| p = sys.argv[1]; sha = os.environ["CA_SHA"] | ||
| s = open(p).read() | ||
| s, n = re.subn(r'^(\s*(?:caSha256|sha256):\s*"?)[0-9a-f]{64}("?)', lambda m: m.group(1) + sha + m.group(2), s, flags=re.M) |
There was a problem hiding this comment.
The CA rewrite changes every block-style sha256 or caSha256 value, not just RDS CA pins. If an EKS install defines relaygate.policy.enrollmentKeys as block mappings, each enrollment key's sha256 gets replaced with the public RDS CA hash. Existing clients can no longer enroll with their keys.
Limit the rewrite to database CA settings that reference rds-ca.
Prompt To Fix With AI
This is a comment left during a code review.
Path: scripts/selfhost/configure-rds.sh
Line: 336
Comment:
**Enrollment keys stop working**
The CA rewrite changes every block-style `sha256` or `caSha256` value, not just RDS CA pins. If an EKS install defines `relaygate.policy.enrollmentKeys` as block mappings, each enrollment key's `sha256` gets replaced with the public RDS CA hash. Existing clients can no longer enroll with their keys.
Limit the rewrite to database CA settings that reference `rds-ca`.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.7a7e88d to
68dc817
Compare
d65e54f to
a7c9eb4
Compare
…tall path Rebuilt on main after #555/#557/#558/#559 (OCI chart install, find_cluster, in-cluster database checks). Earlier review rounds on #556 are folded in. Why configure-rds.sh and not a new install.sh: it already owns the master login, rds-setup.sh pre/post with the HoopDb layout, the release pins, the chart (now the published OCI chart, #557), helm, the migration wait and first sign-in. It now does the rest of the install too, so hand-filling Secrets 01-05 is the bring-your-own option, and databaseGuard checks it. - Secrets: the application keys are generated only when neither the cluster nor the credential files hold them, and never replaced (an empty openssl result stops the run). The ingest introspect-secret is copied, the five Secrets are written in the shapes the guard checks, and the script says what to back up. - values.yaml: the rds-ca sha256 is pinned. The HoopDb layout (worker.migrations.hoopdb, rdsLayout, searchIndexer.bootstrap), relay-control.bootstrap.adminEmail and databaseGuard.statusTest.rbac.create are written into the operator's values file instead of a hidden -f overlay and --set flags, so a later plain helm upgrade keeps them (the rehearsal's rds_profile_unproven at revision 4). Block YAML is edited in place; comments, anchors and flow mappings are untouched. If the file can't be edited, the script falls back to the overlay with a loud warning. - helm: works with the OCI chart and a checkout. On refusal the script points at AR_DB_LOGIN and the db-guard hook log, then stops. - Jobs: wait_job returns at Complete or Failed (reset, migration, search bootstrap), instead of sitting out kubectl wait's timeout on a failed Job. A search bootstrap that failed before rds-setup.sh post is shown with its cause, deleted, and re-run through helm. - --reset-databases checks that the master owns all three databases before dropping any. On a dedicated-owner install it refuses with "Nothing was dropped"; it used to drop two databases and then fail. - Step 8: helm test, then the diagnostic next to the script when there is one. The run ends with one line (HEALTHY, UNHEALTHY or INCOMPLETE) and numbered Next steps. First sign-in waits for the relay-control rollout and retries the port-forward. - diagnose-install.py: find_cluster() retries the probe (8s, 15s, 30s). Skipped workload checks end in "RESULT: INCOMPLETE: workload checks skipped" (exit 3), never a clean summary; otherwise RESULT is FAIL, PARTIAL or PASS. - RELEASE_VERSION=checkout uses this checkout's chart and scripts (not with an OCI chart). - Docs: scripts/selfhost/README.md (OCI-first), examples/aws README and the Secret 01-05 comments, docs/self-hosted-rds-manual-setup.md and docs/self-hosted-eks.md. Registry: opt.agent-relay.database-guard. Tests: configure-rds-chart-test.sh 9/9. Its openssl mock now returns hex, its kubectl mock answers Job status, and step 5 asserts that the layout is in values.yaml with no hidden overlay. scripts/support tests 63/63. configure-rds-e2e (kind + RDS-shaped PG17 with TLS, the rehearsal's Secrets): the hand-filled install is refused up front, and the guided run creates the logins, completes the migrations, mints the key and ends with the verdict. A plain upgrade keeps rdsLayout. A fully healthy run needs S3 and OpenSearch, which the harness doesn't have. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
68dc817 to
e5cdb39
Compare
|
Rebuilt onto main after #555, #557, #558 and #559, as one commit on top of #554.
|
… guided configure-rds.sh (agent-relay 0.7.86, sessions-pipeline 0.8.62) Rebuilt on main after #553 (chart-managed RDS CA) and #548, which took agent-relay 0.7.85 and sessions-pipeline 0.8.61, so this PR moves to 0.7.86 and 0.8.62. It includes #556 (guided configure-rds.sh), which was merged into this PR's branch. #553 already updated databaseGuard for the chart-managed CA: a hook-scoped copy of the bundle, because rds-ca is created after the pre-install hook. The status test reuses those helpers. helm test (agent-relay): - `helm test <release> -n <namespace> --logs` runs a status Pod (relaycast image) and prints one ok/FAIL/skip table and a HEALTHY/UNHEALTHY verdict: - database logins: the databaseGuard rules, plus USAGE on sessions for the HoopDb runtime, read API, ingest and search logins (the rehearsal's "permission denied for schema sessions"); - each CA (kind/name/key) against its pins; - S3 for the AWS provider only, and OpenSearch reachability; - with databaseGuard.statusTest.rbac.create (off by default: the documented operator Role can't create Roles) also: - the newest Job of each kind; CronJob runs are excluded, and a failed search bootstrap shows its recorded cause plus the recovery steps; - Deployments on the current revision; - Pod Identity checked per pod. - databaseGuard also refuses an unset worker.migrations.rdsLayout with a dedicated HoopDb owner when chart migrations are on. This covers a plain upgrade that dropped configure-rds.sh's overlay (rds_profile_unproven). Search bootstrap (sessions-pipeline): - The guard names the cause: a LOGIN wait timeout, an unactivated search login, or any SearchIndexError (OpenSearch unreachable, no AWS credentials, a 403). It writes the cause to the termination message (FallbackToLogsOnError). - The search indexer gets POD_NAMESPACE for its startup hint. configure-rds.sh (from #556): - the guided, primary install path, with the OCI chart or a checkout; - generates the app keys and never replaces existing ones; writes the five Secrets; - writes the HoopDb layout, first admin and status RBAC into the values file instead of a hidden overlay; - Job waits stop at Complete or Failed; a failed search bootstrap is shown, deleted and re-run after post; - --reset-databases checks ownership before dropping anything; - ends with helm test, the diagnostic, a HEALTHY/UNHEALTHY/INCOMPLETE line and Next steps; first sign-in waits for the relay-control rollout; - diagnose-install.py ends with a RESULT line, and skipped workload checks are INCOMPLETE (exit 3). Tests: kind db-guard e2e 19/19 on this tree (with #553's CA changes), ci/rds-ca/test.sh 57 checks, chart static, render, profile matrix, local stack, subdomain goldens (Helm v4.3.1), registry check, support tests, bootstrap guard tests 10/10, version-bump check. Chart.lock changes only the sessions-pipeline version and the lock digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… guided configure-rds.sh (agent-relay 0.7.86, sessions-pipeline 0.8.62) Rebuilt on main after #553 (chart-managed RDS CA) and #548, which took agent-relay 0.7.85 and sessions-pipeline 0.8.61, so this PR moves to 0.7.86 and 0.8.62. It includes #556 (guided configure-rds.sh), which was merged into this PR's branch. #553 already updated databaseGuard for the chart-managed CA: a hook-scoped copy of the bundle, because rds-ca is created after the pre-install hook. The status test reuses those helpers. helm test (agent-relay): - `helm test <release> -n <namespace> --logs` runs a status Pod (relaycast image) and prints one ok/FAIL/skip table and a HEALTHY/UNHEALTHY verdict: - database logins: the databaseGuard rules, plus USAGE on sessions for the HoopDb runtime, read API, ingest and search logins (the rehearsal's "permission denied for schema sessions"); - each CA (kind/name/key) against its pins; - S3 for the AWS provider only, and OpenSearch reachability; - with databaseGuard.statusTest.rbac.create (off by default: the documented operator Role can't create Roles) also: - the newest Job of each kind; CronJob runs are excluded, and a failed search bootstrap shows its recorded cause plus the recovery steps; - Deployments on the current revision; - Pod Identity checked per pod. - databaseGuard also refuses an unset worker.migrations.rdsLayout with a dedicated HoopDb owner when chart migrations are on. This covers a plain upgrade that dropped configure-rds.sh's overlay (rds_profile_unproven). Search bootstrap (sessions-pipeline): - The guard names the cause: a LOGIN wait timeout, an unactivated search login, or any SearchIndexError (OpenSearch unreachable, no AWS credentials, a 403). It writes the cause to the termination message (FallbackToLogsOnError). - The search indexer gets POD_NAMESPACE for its startup hint. configure-rds.sh (from #556): - the guided, primary install path, with the OCI chart or a checkout; - generates the app keys and never replaces existing ones; writes the five Secrets; - writes the HoopDb layout, first admin and status RBAC into the values file instead of a hidden overlay; - Job waits stop at Complete or Failed; a failed search bootstrap is shown, deleted and re-run after post; - --reset-databases checks ownership before dropping anything; - ends with helm test, the diagnostic, a HEALTHY/UNHEALTHY/INCOMPLETE line and Next steps; first sign-in waits for the relay-control rollout; - diagnose-install.py ends with a RESULT line, and skipped workload checks are INCOMPLETE (exit 3). Tests: kind db-guard e2e 19/19 on this tree (with #553's CA changes), ci/rds-ca/test.sh 57 checks, chart static, render, profile matrix, local stack, subdomain goldens (Helm v4.3.1), registry check, support tests, bootstrap guard tests 10/10, version-bump check. Chart.lock changes only the sessions-pipeline version and the lock digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… guided configure-rds.sh (agent-relay 0.7.87, sessions-pipeline 0.8.62) (#554) * feat(agent-relay): helm test install status, search bootstrap causes, guided configure-rds.sh (agent-relay 0.7.86, sessions-pipeline 0.8.62) Rebuilt on main after #553 (chart-managed RDS CA) and #548, which took agent-relay 0.7.85 and sessions-pipeline 0.8.61, so this PR moves to 0.7.86 and 0.8.62. It includes #556 (guided configure-rds.sh), which was merged into this PR's branch. #553 already updated databaseGuard for the chart-managed CA: a hook-scoped copy of the bundle, because rds-ca is created after the pre-install hook. The status test reuses those helpers. helm test (agent-relay): - `helm test <release> -n <namespace> --logs` runs a status Pod (relaycast image) and prints one ok/FAIL/skip table and a HEALTHY/UNHEALTHY verdict: - database logins: the databaseGuard rules, plus USAGE on sessions for the HoopDb runtime, read API, ingest and search logins (the rehearsal's "permission denied for schema sessions"); - each CA (kind/name/key) against its pins; - S3 for the AWS provider only, and OpenSearch reachability; - with databaseGuard.statusTest.rbac.create (off by default: the documented operator Role can't create Roles) also: - the newest Job of each kind; CronJob runs are excluded, and a failed search bootstrap shows its recorded cause plus the recovery steps; - Deployments on the current revision; - Pod Identity checked per pod. - databaseGuard also refuses an unset worker.migrations.rdsLayout with a dedicated HoopDb owner when chart migrations are on. This covers a plain upgrade that dropped configure-rds.sh's overlay (rds_profile_unproven). Search bootstrap (sessions-pipeline): - The guard names the cause: a LOGIN wait timeout, an unactivated search login, or any SearchIndexError (OpenSearch unreachable, no AWS credentials, a 403). It writes the cause to the termination message (FallbackToLogsOnError). - The search indexer gets POD_NAMESPACE for its startup hint. configure-rds.sh (from #556): - the guided, primary install path, with the OCI chart or a checkout; - generates the app keys and never replaces existing ones; writes the five Secrets; - writes the HoopDb layout, first admin and status RBAC into the values file instead of a hidden overlay; - Job waits stop at Complete or Failed; a failed search bootstrap is shown, deleted and re-run after post; - --reset-databases checks ownership before dropping anything; - ends with helm test, the diagnostic, a HEALTHY/UNHEALTHY/INCOMPLETE line and Next steps; first sign-in waits for the relay-control rollout; - diagnose-install.py ends with a RESULT line, and skipped workload checks are INCOMPLETE (exit 3). Tests: kind db-guard e2e 19/19 on this tree (with #553's CA changes), ci/rds-ca/test.sh 57 checks, chart static, render, profile matrix, local stack, subdomain goldens (Helm v4.3.1), registry check, support tests, bootstrap guard tests 10/10, version-bump check. Chart.lock changes only the sessions-pipeline version and the lock digest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * fix(agent-relay): status review fixes (no old replicas in a done rollout, unbuildable URLs become rows, pins from running components only) CodeRabbit on #554: - A Deployment row is ok only when status.replicas equals updatedReplicas: old-revision pods still count as ready and available, so a one-replica stuck rollout read ok. - reach() catches https.request construction errors (e.g. an http:// URL) and turns them into a FAIL row instead of rejecting and aborting the table. - CA pins come only from components that run (worker always; read API, ingest and search indexer when enabled), so a disabled component's stale hash can't fail a valid bundle. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * chore(agent-relay): update subdomain goldens for the status script change (Helm v4.3.1) Only the status ConfigMap's script content changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Stacked on #554 (helm test status). GitHub retargets it to
mainonce #554 merges. Part D of the series after #552 (databaseGuard, merged).Why configure-rds.sh, not a new install.sh
configure-rds.shalready owns the hard part end to end: the master-login handling,rds-setup.sh pre/postwith the HoopDb layout overlay, the release pins, helm, the migration wait and first sign-in. Customers and support already know it by name. A new entry point would only wrap or duplicate it. So it now covers the whole install, and hand-filled Secrets 01–05 become the bring-your-own option, whichdatabaseGuardchecks.What changed
selfhost-encryption-keyorSUMMARY_MASTER_KEYSloses data. It copies the ingestintrospect-secret, writes the five Secrets in the shapes the guard checks, and tells you what to back up.caSha256/sha25664-hex value invalues.yaml. If the chart computes the CA hash itself (the chart-owned CA work), there is nothing to replace and this does nothing.databaseGuard.statusTest.rbac.create=true(STATUS_RBAC=0to opt out). If helm refuses, the script points at theAR_DB_LOGINmessage and thedb-guardhook log, then stops.rds-setup.sh post, a search bootstrap Job that hasn't succeeded is deleted and re-run through helm. The wait stops on Complete or Failed and prints the Job's last lines. In the rehearsal, the failed Job kept its name, helm never re-ran it, and the indexer crash-looped onpermission denied for schema sessions.curl: (7) Failed to connect to 127.0.0.1:18787.helm testand then the support diagnostic, followed by one plain line (HEALTHY,UNHEALTHYorINCOMPLETE) and numberedNext:steps.RESULT: INCOMPLETE: workload checks skipped ...with exit 3, never a clean-looking summary. It also printsRESULT: FAIL,PARTIALorPASS. The installer prefers the diagnostic next to it in the checkout over the older pinned download.RELEASE_VERSION=checkout: uses this checkout's chart,rds-setup.shand diagnostic as they are, for unreleased charts and tests.scripts/selfhost/README.mdleads with the installer.examples/aws/README.mdand the Secret 01–05 comments describe hand-written Secrets as bring-your-own, subject to the guard.docs/self-hosted-rds-manual-setup.mdanddocs/self-hosted-eks.mdpoint to the installer first. Registry:opt.agent-relay.database-guard, docs regenerated withcheckpassing.Later commits (coordinator addenda from the live rehearsal)
worker.migrations.hoopdb,rdsLayout,searchIndexer.bootstrap),relay-control.bootstrap.adminEmailanddatabaseGuard.statusTest.rbac.createused to be passed as an extra-f $STATE_DIR/hoopdb-layout-values.yamlplus--setflags. They are now written into the operator's values file (a.bakis kept), so a later plainhelm upgradewith the documented-ffiles keeps them. In the rehearsal, dropping them made the migrate Job fail withrds_profile_unprovenat revision 4. The writer edits block YAML in place and never touches comments, anchors or flow mappings. If it can't edit the file, the script falls back to the overlay with a loud warning. The chart guard in feat(agent-relay): helm test install status, search bootstrap causes, guided configure-rds.sh (agent-relay 0.7.87, sessions-pipeline 0.8.62) #554 also refuses an unsetrdsLayoutthat comes with a dedicated HoopDb owner.--reset-databaseson a dedicated-owner install: this used to droprelaycontrolandrelaycastand then fail withmust be owner of database hoopdb. The reset now checks ownership first and refuses with "Nothing was dropped" (verified: refused in 5 seconds).wait_jobreturns as soon as a Job is Complete or Failed. It covers the reset, migration and search bootstrap waits;kubectl wait --for=condition=completesat out its full timeout (300s or 1200s) on a Job that had already failed. The fresh e2e now takes 766 seconds, down from more than 25 minutes.Tests
scripts/selfhost/tests/configure-rds-e2eruns on kind with an RDS-shaped PG17 over TLS and replays the rehearsal's exact Secrets (every URL logs in aspostgres, and 04 holds a bare URL).helm installis now refused before anything is applied:--reset-databases. The logins were created and the keys generated. The CA was pinned (4 values). The guard hook passed, and all three migrate Jobs completed.postreportedlogin ok … tls=truefor the read API, ingest and search logins. The early search bootstrap was deleted and re-run,helm testprinted the table, and the first sign-in key was minted.a plain helm upgrade (documented -f files only) keeps rdsLayout (separate-database), the generated keys, the minted setup key, and the credential checks. The rows that need S3 or OpenSearch fail, as described below.sessionsgrant. The status table and the diagnostic both report exactly that, and those 04 rows fail. A fully HEALTHY end to end needs real or faked S3 and OpenSearch: not verified here.scripts/support/tests: 26/26, including the new retry and INCOMPLETE tests.shellcheck -S warningand the registrycheckpass.🤖 Generated with Claude Code
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Summary by cubic
Makes
configure-rds.shthe guided, primary install path for EKS + RDS. It creates the database logins, writes the install Secrets, pins the CA and image digests, runs helm with the status-test RBAC, reruns a failed search bootstrap, and ends withhelm testplus one verdict line. Hand-writing Secrets 01–05 is now the bring-your-own option, refused by the chart when a URL logs in as the RDS master, shares a login between roles, or has the wrong shape.Installer
caSha256/sha256invalues.yaml.values.yamlso a later plain helm upgrade keeps them; falls back to an overlay with a loud warning when the YAML shape isn't editable.rds-setup.sh postactivated the search logins).--reset-databaseswhen the master can't act as owner of all three databases: nothing is dropped.RELEASE_VERSION=checkoutto run this checkout's chart and scripts instead of pinned releases.Diagnostic
diagnose-install.pyretries the cluster probe 3 times (8s, 15s, 30s) and always ends withRESULT: FAIL,PARTIAL,PASS, orINCOMPLETE; skipped workload checks exit 3, never a clean-looking summary.Next:steps.opt.agent-relay.database-guardwas added to the requirements registry.Written for commit e5cdb39. Summary will update on new commits.