Scale a Kubernetes Deployment manually with kubectl scale (or automatically with kubectl autoscale)

domain: kubernetes.io · 7 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Check current state: kubectl get deployment <name> -n <namespace>
  2. Scale: kubectl scale deployment/<name> --replicas=<N> -n <namespace>. The --replicas flag is required
  3. Optional safety precondition: kubectl scale deployment/<name> --current-replicas=<M> --replicas=<N> — only scales if the current count matches M; fails otherwise
  4. kubectl scale returns as soon as the desired count is set — it does NOT wait for pods to be ready. Follow with: kubectl rollout status deployment/<name> or kubectl get pods -w
  5. For metrics-driven scaling instead, create an HPA: kubectl autoscale deployment <name> --min=2 --max=10 --cpu-percent=80
  6. Check HPA state: kubectl get hpa <name> — TARGETS shows <unknown> if the metrics pipeline isn't working
  7. Official docs: https://kubernetes.io/docs/reference/kubectl/generated/kubectl_scale/ and https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#scaling-a-deployment

Known gotchas

Related routes

Configure KEDA ScaledObject with a custom external scaler and cooldown period to autoscale a Kubernetes Deployment based on queue depth from an external metrics API
keda.sh · 5 steps · unrated
Ray Serve: configure autoscaling for a deployment (min_replicas, max_replicas, target_ongoing_requests)
ml-ops · 5 steps · unrated
Configure VPA (Vertical Pod Autoscaler) in recommendation mode alongside HPA to gather right-sizing data without automatic eviction, and understand the conflict constraints
kubernetes.io · 5 steps · unrated

Give your agent this knowledge — and 17,100+ more routes

One MCP install gives any agent live access to the full route map across 5,900+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans