Skip to content

Load Loop client TLS from Secret Manager - #131

Merged
Alex R (alexr17) merged 7 commits into
mainfrom
alexr/loop-public-setup
Nov 24, 2026
Merged

Alex R (alexr17) merged 7 commits into
mainfrom
alexr/loop-public-setup

Conversation

@alexr17

@alexr17 Alex R (alexr17) commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Loop Runtime on GKE can load client TLS credentials directly from Google Secret Manager using Workload Identity.
Set loopRuntime.sandbox.clientTlsSecret to a secret version reference to load the bundle into memory and mount it read-only.
This supports Terraform-generated bundles and direct Helm deployments without copying private keys into Helm values.
Leaving the setting empty preserves the existing sandbox-client-tls Kubernetes Secret.

Input Behavior
Google, Loop enabled, Secret Manager version reference Load the client bundle into memory through Workload Identity; runtime mounts it read-only.
Named or numeric project; latest or numeric secret version Preserve the exact reference in the init container.
Reference missing, null or empty string Retain the external sandbox-client-tls Kubernetes Secret mount.
Reference is zero, boolean, map, list, URL, traversal, missing version or query string Reject during chart rendering.
Loop disabled on Google, AWS or Azure Omit runtime and credential loading.
Loop enabled on AWS or Azure Preserve existing unsupported-cloud validation.
Reused pre-Loop values; missing/null Loop maps and partial overrides Preserve the existing disabled/default merge behavior.
Startup ordering enabled or disabled Preserve migration and Brainstore checks; append TLS initialization after them when enabled.
Release tags with/without v, full/short/numeric SHA, prerelease or custom tag Preserve the image string for both runtime and init container.
Replicas missing/null/empty or zero Preserve default one or explicit zero; credentials load only when Pods start.
Native/external TLS and Loop on/off transitions Switch init container and volume with the Pod template; leave externally managed Secrets untouched.
Secret reference changes; latest contents change A reference change rolls Pods; changed latest contents are loaded on their next startup.

The loader tests cover authenticated requests, file permissions, retries, malformed bundles and restarting after read-only files exist.

The public Terraform bootstrap installs workers and retains TLS for this configuration.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-24T18:09:12.891836Z 46003d6 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alexr17 Alex R (alexr17) changed the title Make managed Terraform the default Loop setup Install Loop client TLS from generated values Nov 21, 2026
@alexr17 Alex R (alexr17) changed the title Install Loop client TLS from generated values Load Loop client TLS from Secret Manager Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Already looking forward to the next diff.

Reviewed commit: 022611fbb2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 3e5879f73a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

@erikdw Erik Weathers (erikdw) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. This should release before data-plane#52 and gke-app#26, since gke-app checks for clientTlsSecret support at plan time. One optional docs suggestion inline.

Comment on lines +29 to +30
Deploy compatible API, Brainstore and routed AI Gateway versions first. Keep the
generated runtime/worker version compatible with those services. For a Standard

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could this be a concrete check, to match the plan-time check proposed for gke-app#26? The overlay pins loopRuntime.image.tag to the data-plane module's worker version and is applied last, so after a chart upgrade the runtime silently stays on the old tag. Something like:

helm show values oci://public.ecr.aws/braintrust/helm/braintrust --version <chart-version> | yq '.loopRuntime.image.tag'
yq '.loopRuntime.image.tag' loop-values.yaml

If they differ, upgrade the data-plane module, or pin loop_runtime_options.services_version deliberately.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added both concrete tag-inspection commands in 46003d6 and documented upgrading the data-plane module or deliberately pinning its services version when they differ. App #26 now performs the corresponding plan-time drift check.

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. More of your lovely PRs please.

Reviewed commit: 6223373a6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Copy link
Copy Markdown
Contributor Author

/devin review

Review scope: this is a forward fix for the shared Loop setup used by module-managed and existing GKE clusters. Target the new installer/Helm-values interface. Preserving the previous app/infra input-output contract and automating migration of old worker-provider/TLS ownership are out of scope; intentional breaking changes should be versioned and documented. Please flag correctness, IAM/TLS, readiness and unsafe resource-handling issues, and keep recommendations small and general.

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

Review scope: this is a forward fix for the shared Loop setup used by module-managed and existing GKE clusters. Target the new installer/Helm-values interface. Preserving the previous app/infra input-output contract and automating migration of old worker-provider/TLS ownership are out of scope; intentional breaking changes should be versioned and documented. Please flag correctness, IAM/TLS, readiness and unsafe resource-handling issues, and keep recommendations small and general.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🎉

Reviewed commit: 6223373a6f

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Copy link
Copy Markdown
Contributor Author

/devin review

Please review the latest commit as a v3.0.0 forward fix of the shared installer/Helm-values contract. Legacy app/infra interfaces and automated provider/TLS migration are out of scope. Check correctness, execution recovery, version coordination, IAM/TLS, readiness and safe resource ownership; keep recommendations small and general.

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

Please review the latest commit as a v3.0.0 forward fix of the shared installer/Helm-values contract. Legacy app/infra interfaces and automated provider/TLS migration are out of scope. Check correctness, execution recovery, version coordination, IAM/TLS, readiness and safe resource ownership; keep recommendations small and general.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 46003d62c2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "Codex (@codex) review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "Codex (@codex) address that feedback".

Alex R (alexr17) added a commit to braintrustdata/terraform-google-braintrust-data-plane that referenced this pull request Nov 24, 2026
Enabling Loop currently creates a cluster but leaves worker installation
and TLS to another deployment. Following the [AWS
bootstrap](braintrustdata/terraform-aws-braintrust-data-plane#514),
`enable_loop_runtime = true` now runs a pinned Cloud Run installer and
retains TLS in Secret Manager.
Module-managed and existing GKE clusters share the installer and ready
Helm output through `modules/gke-loop-bootstrap`.

The installer reuses
`loop_runtime_options.installer_service_account_email` (or
`deploy_service_account_email`) when supplied; otherwise Terraform
creates an account with project-wide `roles/container.admin`. [GKE IAM
cannot restrict Kubernetes object access to one
cluster](https://docs.cloud.google.com/kubernetes-engine/docs/concepts/access-control).
Deployment requires `roles/run.developer`. Fresh projects use built-in
DNS roles with writes limited to the private discovery zone.

The [app
module](braintrustdata/terraform-google-braintrust-gke-app#26)
and [direct Helm
installs](braintrustdata/helm#131) consume the
same configuration without generated keys in Terraform state or Helm
values. Runtime secret access is client-only; setup verifies the worker
chart checksum and waits for updated workers to be Ready, including
OnDelete StatefulSets.

This is a data-plane v4.0.0 forward fix of the app/infra contract:
release the chart first, then drain and apply infrastructure v4 before
app v3; the first bootstrap creates new TLS roots and Loop is
unavailable until the app apply.

Earlier live smoke passed with automatic and supplied installer
identities: native mTLS, rejection without a client certificate,
client-only secret access, a no-change plan, and drain-to-zero without
TLS rotation.
Execution-cycle recovery and version-pin checks also passed in live
smoke. A forced-failure smoke test verified that ready outputs require
the [specific
execution](https://docs.cloud.google.com/run/docs/reference/rest/v2/projects.locations.jobs.executions)
to succeed, and that replacing its trigger retries the same
configuration.
@alexr17
Alex R (alexr17) enabled auto-merge (squash) November 24, 2026 23:26
@alexr17
Alex R (alexr17) merged commit 0a023dc into main Nov 24, 2026
3 checks passed
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