Skip to content

Support autoscaling the API on GKE - #95

Merged
brianvans (brianvans) merged 13 commits into
mainfrom
brianvans/support-autoscaling-api-on-gke
Aug 17, 2026
Merged

Support autoscaling the API on GKE#95
brianvans (brianvans) merged 13 commits into
mainfrom
brianvans/support-autoscaling-api-on-gke

Conversation

@brianvans

@brianvans brianvans (brianvans) commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Adds optional Horizontal Pod Autoscaling on GKE using native AutoscalingMetric support. When turned on, the API scales on CPU, event-loop utilization, and mean event-loop delay (same signals we use on AWS ECS), and Prometheus metrics are enabled automatically. Requires GKE 1.35.1+.

This has a hard requirement on v2.9.0+ of the Braintrust data plane, as this introduced the internal /metrics endpoint capability.

See https://docs.cloud.google.com/kubernetes-engine/docs/how-to/expose-custom-metrics-autoscaling for docs on the GKE preview feature that backs this.

Adds optional Horizontal Pod Autoscaling on GKE using native
AutoscalingMetric support. When turned on, the API scales on CPU,
event-loop utilization, and mean event-loop delay (same signals we use
on AWS ECS), and Prometheus metrics are enabled automatically. Requires
GKE 1.35.1+.

See https://docs.cloud.google.com/kubernetes-engine/docs/how-to/expose-custom-metrics-autoscaling

@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.

Two small follow-ups. Neither blocks merge.

Comment thread braintrust/templates/api-deployment.yaml Outdated
Comment thread braintrust/README.md
Comment thread braintrust/values.yaml Outdated

@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.

:shipit:

Integrate GKE API autoscaling with workload isolation pools so each
rendered API pool gets its own AutoscalingMetric and HPA when enabled.
@brianvans

Copy link
Copy Markdown
Contributor Author

I had to change things up a bit for autoscaling of the isolated API pools that were introduced in #97.

See braintrust/examples/google-api-isolation-autoscaling/values.yaml for a minimal example of autoscaling the workload-specific API pools independently

Comment thread braintrust/examples/google-api-isolation-autoscaling/values.yaml Outdated
Comment thread braintrust/examples/google-api-isolation-autoscaling/values.yaml Outdated
Comment thread braintrust/tests/api-autoscaling_test.yaml
Comment thread braintrust/values.yaml
Comment thread braintrust/templates/api-hpa.yaml Outdated
Comment thread braintrust/README.md
Comment thread braintrust/README.md
Better document hard requirement on v2.9.0 for /metrics endpoint

@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.

🚢 🇮🇹

@brianvans
brianvans (brianvans) merged commit 7f48649 into main Aug 17, 2026
3 checks passed
@erikdw
Erik Weathers (erikdw) deleted the brianvans/support-autoscaling-api-on-gke branch August 18, 2026 00:35
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