Skip to content

Add opt-in Brainstore startup gate for API pods - #104

Merged
Alexey Soldatchenko (soldatchenko) merged 6 commits into
mainfrom
codex/brainstore-api-init-gate
Oct 2, 2026
Merged

Alexey Soldatchenko (soldatchenko) merged 6 commits into
mainfrom
codex/brainstore-api-init-gate

Conversation

@soldatchenko

@soldatchenko Alexey Soldatchenko (soldatchenko) commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Helm can start a new API before Brainstore supports its query behavior. This adds an opt-in init container that waits for compatible Brainstore capacity, allowing a single Helm upgrade without customer-side sequencing steps.

Behavior

  • api.brainstoreStartupGate.enabled defaults to false and applies to every API pool.
  • Checks reader, writer, and fastreader readiness and release tags. Incompatible pods, including terminating pods, block startup. Two successful checks release the gate; failures and timeouts keep the API stopped for Kubernetes to retry.
  • Each API pod keeps its own minimum version, defaulting to its API release tag. Newer Brainstore releases in the same major are accepted, allowing older APIs to restart during later compatible rollouts.
  • Uses namespace-scoped read-only RBAC and a restricted helper container. Only the init container mounts the Kubernetes API token; custom sidecars needing API access must project their own.

Requires stable release tags, API rolling updates with zero unavailable replicas and nonzero surge, sufficient surge capacity, and Kubernetes API access. Application owners must confirm the assumed release compatibility. Rollback sequencing is not covered; Brainstore downgrades can temporarily cause query errors.

Validation

  • 33 Python tests, 342 Helm tests, provider renders, and lint passed; CI is green.
  • Gate-enabled provider/isolation renders and packaged-chart checks passed.
  • No cluster canary yet. Keep this draft and disabled by default until real queries, upgrade/retry behavior, older API restarts, rollback convergence, and fresh installation are tested.

@soldatchenko
Alexey Soldatchenko (soldatchenko) marked this pull request as ready for review October 1, 2026 19:30
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-01T19:33:45.424738Z afe6af8 Draft marked ready
ℹ️ 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.

Comment thread braintrust/values.yaml Outdated
Co-authored-by: Kevin Green <kevin.green@braintrust.dev>
Comment on lines +3 to +4
{{- $defaults := dict
"enabled" false

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.

Suggested change
{{- $defaults := dict
"enabled" false
{{- $defaults := dict
"enabled" true

I guess this might need to be bumped too?

@soldatchenko
Alexey Soldatchenko (soldatchenko) merged commit e353c7e into main Oct 2, 2026
2 of 3 checks passed
@soldatchenko
Alexey Soldatchenko (soldatchenko) deleted the codex/brainstore-api-init-gate branch October 2, 2026 20:54
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