---
id: w1/m20/t004
title: Dashboard Scaling section (min/max + target controls)
worker: worker1
status: done
estimate: 60m
depends_on: [w1/m20/t003]
---

## Objective

Add a Scaling section to the service detail page: enable autoscaling, set min/max instances and target CPU/memory %, read and write via the GraphQL surface from t003. Mirror Render's Scaling tab layout.

## Context

- `dashboard/` — TanStack Start + Apollo + shadcn; read `dashboard/CLAUDE.md` before editing.
- Consumes bex-api GraphQL only (no direct k8s/CR access).
- Existing metrics page already shows CPU/mem % of limit (m8, w3/m4.5) — reuse that context near the controls.

## Steps

1. Add a Scaling section/card on the service page with an enable toggle, min/max inputs, and target CPU/mem % inputs (disabled unless enabled).
2. Wire the read query + write mutation from t003; optimistic/refetch on save.
3. Validate min ≤ max and 1–100 percentages client-side, matching the CRD markers.

## Files

- `dashboard/…` (service-detail Scaling section + GraphQL operations)

## Acceptance criteria

- [ ] The section reads current autoscaling config and persists edits via GraphQL.
- [ ] Client validation matches the CRD constraints; layout mirrors Render's Scaling tab.

## Out of scope

- Backend/reconciler work (t001–t003).
