Skip to content

update example to use role label instead of name - #101

Open
Jeff McCollum (jeffmccollum) wants to merge 6 commits into
mainfrom
jeff/gke-standard
Open

Jeff McCollum (jeffmccollum) wants to merge 6 commits into
mainfrom
jeff/gke-standard

Conversation

@jeffmccollum

@jeffmccollum Jeff McCollum (jeffmccollum) commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

terraform-google-braintrust-data-plane#27 labels Standard nodes with braintrust/workload=services or braintrust/workload=brainstore. GKE names those pools with a generated suffix, so the example selectors cloud.google.com/gke-nodepool: api and : brainstore match nothing and the pods stay Pending.

This points the Standard example at braintrust/workload. A replacement pool keeps that label when its Terraform key is different.

#27 drains the old pool while respecting PDBs. The example sets maxUnavailable: 1 on the API and the Brainstore reader, fast reader, and writer. Chart defaults leave those budgets off.

Merge this with or before #27. That module's Standard example links this values file on main.

Brainstore PDB inputs

Applies to each of brainstore.reader, fastreader, and writer, on AWS, Azure, and Google:

podDisruptionBudget Result
Chart default (enabled: false) No PDB
Missing or null (--reuse-values from an older chart) No PDB
enabled: true, maxUnavailable missing or null maxUnavailable: 1
enabled: true, maxUnavailable: 0 maxUnavailable: 0
enabled: true, maxUnavailable: "25%" maxUnavailable: "25%"

Each row has a helm-unittest case in brainstore-pdb_test.yaml.

API PDB inputs

Applies to the default API pool and each enabled isolated pool on AWS, Azure, and Google:

podDisruptionBudget Result
enabled: false, including when a maximum is set No PDB
Missing or null map in retained values No PDB
enabled: true, maxUnavailable missing or null Configured minAvailable
enabled: true, maxUnavailable: 0 maxUnavailable: 0; omit minAvailable
enabled: true, maxUnavailable: 1 maxUnavailable: 1; omit minAvailable
enabled: true, maxUnavailable: "25%" Preserve the percentage; omit minAvailable
enabled: true, maxUnavailable: "" Preserve the empty string for Kubernetes validation
Isolated pool overrides an inherited maximum with null That pool uses its configured minAvailable

Covered in brainstore-pdb_test.yaml, including partial overrides and retained values.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 8, 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-09-09T22:13:05.373406Z 0c8d7e4 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 49807d61b1

ℹ️ 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".

Comment thread braintrust/README.md Outdated

For Standard mode clusters, create node pools with local SSDs, then deploy:

Use the stable `braintrust/node-pool` role label in each node selector. Terraform node pool replacements can use generated GKE pool names.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Tell users to apply the custom node label

For manually created GKE Standard pools or clusters produced by a Terraform module version predating the referenced module change, no node has the custom braintrust/node-pool label—GKE only supplies the former cloud.google.com/gke-nodepool label automatically. The new selectors therefore leave the API and every Brainstore pod Pending, while this section only tells users to create pools and configure selectors. Document the compatible Terraform module version and how to label manually created pools before directing users to these selectors.

Useful? React with 👍 / 👎.

@jeffmccollum

Copy link
Copy Markdown
Contributor Author

Codex (@codex) review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

Reviewed commit: 0c8d7e4548

ℹ️ 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".

The Terraform module sets braintrust/node-pool to each pool's map key, so a
Brainstore replacement pool keyed differently never matched the brainstore
selector and Brainstore pods could not move to it. braintrust/workload is
shared by every pool that serves a workload, which is what the Terraform
module's README tells Helm to select on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`helm upgrade --reuse-values` from a chart without Brainstore budgets left
`podDisruptionBudget` unset, and the template failed to render on every cloud.
Treat a missing or null budget map as disabled, and default a missing or null
`maxUnavailable` to 1 while keeping an explicit 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Comment thread braintrust/templates/api-pdb.yaml Outdated
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if hasKey $api.podDisruptionBudget "maxUnavailable" }}

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.

if we have

  podDisruptionBudget:
    enabled: true
    minAvailable: 2
    maxUnavailable: null

then we'll now render maxUnavailable: null with no minAvailable which is unexpected.

We could perhaps normalize it like in Brainstore first and then do something like

   {{- $api := $pool.config -}}
  -{{- if $api.podDisruptionBudget.enabled }}
  +{{- $pdb := $api.podDisruptionBudget | default dict -}}
  +{{- if $pdb.enabled }}
  -  {{- if hasKey $api.podDisruptionBudget "maxUnavailable" }}
  -  maxUnavailable: {{ $api.podDisruptionBudget.maxUnavailable | toYaml | trim }}
  +  {{- if ne $pdb.maxUnavailable nil }}
  +  maxUnavailable: {{ $pdb.maxUnavailable | toYaml | trim }}
     {{- else }}
  -  minAvailable: {{ $api.podDisruptionBudget.minAvailable }}
  +  minAvailable: {{ $pdb.minAvailable }}
     {{- end }}

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.

Agreed—fixed in bd65df5 using the suggested normalization and nil check. A null maximum falls back to minAvailable, including when an isolated pool clears an inherited maximum; explicit zero still takes precedence. Missing PDB maps also render safely. Added regression coverage and updated the input matrix. The full chart test script passes.

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.

4 participants