Add fixed-capacity API workload isolation pools - #97
Add fixed-capacity API workload isolation pools#97Alexey Soldatchenko (soldatchenko) wants to merge 4 commits into
Conversation
Validation completed
|
|
This PR intentionally ports the workload-isolation model introduced in AWS PR #287. The k8s implementation uses Deployments, Services, and GKE Ingress rather than ECS services and ALB target groups, but preserves the same traffic contract: ingestion is isolated from scoring/evals/proxy background work, while all other API traffic remains on the default pool. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1304354ef5
ℹ️ 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".
This adds an opt-in workload-isolation capability for Kubernetes data planes whose ingress or gateway can route traffic to the dedicated Services.
For existing deployments, upgrading to a chart release that includes this change does not enable workload isolation or change the existing API routing. When
api.workloadIsolation.enabled: false, the chart renders no additional API pools and preserves the default API Deployment and Service behavior.To enable isolation, deploy the chart with the feature enabled, verify the dedicated workloads and Services are healthy, then configure the ingress or gateway to route the paths below. The chart does not configure public routing. Enablement creates two API Deployments and Services, and changes Brainstore's internal scoring/function target to the background Service. Plan for a rolling update of the API and Brainstore workloads.
This feature uses fixed replica counts; it does not configure HPA or other autoscaling behavior.
Route contract
The ingress or gateway remains the route owner. It must keep
braintrust-apias the fallback backend and route this path set to the dedicated Services:braintrust-api(default)braintrust-api-ingest/logs3,/otel/v1/traces,/attachment,/attachment/statusbraintrust-api-background/v1/eval,/v1/eval/*,/function/eval,/function/sandbox,/function/use,/function/invoke-async-batch,/function/insert-functions,/automation/logs/trigger,/v1/proxy/chat/completions,/v1/proxy/responsesGKE routing is path-based rather than method-aware, so matching paths are isolated for all HTTP methods.
Rollback
First route the isolated public paths back to the default API Service and verify it is serving them. Only then disable workload isolation in the chart. The chart cannot update an external ingress or gateway on its own.