kubernetes-autoscaling
Skill0 starsChanged 41 days agoMITView on GitHub
Use when designing or reviewing Kubernetes autoscaling — HPA behavior/metrics, VPA, KEDA event-driven scaling and scale-to-zero, cluster-autoscaler, and Karpenter node provisioning. Mention "autoscaling", "hpa", "vpa", "keda", "scaledobject", "karpenter", "nodepool", "cluster-autoscaler", "scale to zero" as triggers.
In this repository45 other files it gives its agents.
- admission-policy-reviewSkill
- alert-rule-reviewSkill
- architecture-reviewSkill
- argocd-applicationsetSkill
- argocd-debugSkill
- argocdSkill
- cert-manager-debugSkill
- cicd-reviewSkill
- cilium-debugSkill
- ciliumSkill
- cluster-backupSkill
- dast-reviewSkill
- dockerfile-reviewSkill
- english-technical-messageSkill
- git-messageSkill
- gitops-reviewSkill
- go-bugfixSkill
- go-code-reviewSkill
- go-testing-reviewSkill
- grafana-dashboardsSkill
- helm-reviewSkill
- homelab-change-planSkill
- incident-analysisSkill
- ingressSkill
- interview-system-designSkill
- istio-debugSkill
- istioSkill
- kubernetes-debugSkill
- kubernetes-securitySkill
- kubernetes-yaml-reviewSkill
- migration-planSkill
- observability-reviewSkill
- observability-stackSkill
- production-readinessSkill
- pr-reviewSkill
- root-cause-analysisSkill
- runbook-writerSkill
- runtime-security-reviewSkill
- secrets-managementSkill
- storage-debugSkill
- supply-chain-securitySkill
- terraform-reviewSkill
- upgrade-readinessSkill
- vaultSkill
- vulnerability-triageSkill
The file
We split this skill into the rules it gives an agent
7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈7
Distinctive · estimate
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 18
Before proposing a metric, threshold, or replica floor, establish the measured bottleneck, honest resource requests, available metrics, and …
- Distinctive: line 20
If these are unknown, give read-only checks and decision branches instead of numeric manifests.
- Distinctive: line 24
Read requests, HPA/KEDA status, Pending events, and node provisioner decisions.
- Distinctive: line 28
Do not tune CPU scaling when the queue or another external signal is the bottleneck.
- Distinctive: line 32
Follow the Workflow, Safety rules, and Quality checklist below.
- Distinctive: line 43
Use when adding, tuning, or reviewing autoscaling at either layer: workload (HPA, VPA, KEDA ScaledObject/ScaledJob) or node …
- Distinctive: line 102
Never propose disabling autoscaling (or pinning replicas) as a quick fix for thrashing — tune stabilization/policies against the observed …
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Kubernetes Autoscaling
TL;DR checklist
- Identify workload scaling versus node provisioning.
- Check resource requests and the metric source first.
- Match scaling policy and disruption protection to the bottleneck.
Answer must include
Before proposing a metric, threshold, or replica floor, establish the measured bottleneck, honest resource requests, available metrics, and node capacity and disruption constraints. If these are unknown, give read-only checks and decision branches instead of numeric manifests.
Key read-only checks
- Read requests, HPA/KEDA status, Pending events, and node provisioner decisions.
Common pitfalls
- Do not tune CPU scaling when the queue or another external signal is the bottleneck.
Agent procedure
Follow the Workflow, Safety rules, and Quality checklist below.
Quick references
- references/workload-autoscaling.md
- references/node-autoscaling.md
Last verified: unverified
When to use
Use when adding, tuning, or reviewing autoscaling at either layer: workload (HPA, VPA, KEDA
ScaledObject/ScaledJob) or node (cluster-autoscaler, Karpenter). Also use when scaling
misbehaves by design — thrashing replicas, pods Pending with "0/N nodes available", scale-to-zero
questions. For a workload that's failing rather than mis-scaling, start with kubernetes-debug;
for whether the service can survive scaling events at all (PDBs, graceful shutdown), see
production-readiness.
Goal
Autoscaling that responds to the actual bottleneck signal, doesn't fight itself (HPA vs VPA, KEDA vs hand-written HPA), respects disruption budgets, and — at the node layer — provisions right-sized capacity instead of whatever the fixed node group happens to offer.
Workflow
Scope to a layer and load its reference:
Layer Reference Workload: HPA (metrics, behavior), VPA (modes, conflicts), KEDA (scalers, scale-to-zero) references/workload-autoscaling.mdNode: cluster-autoscaler vs Karpenter, consolidation, disruption control references/node-autoscaling.md- Confirm the prerequisites before any recommendation — autoscaling is built on two
foundations that are broken more often than the autoscaler itself:
- Resource requests set and honest — HPA CPU% is a percentage of requests; Karpenter and cluster-autoscaler size capacity purely from requests. Wrong requests = wrong scaling everywhere, and no tuning fixes it.
- The metric exists — metrics-server for resource metrics; a Prometheus adapter or KEDA
for anything custom/external.
kubectl top podsfailing means HPA is blind.
- Scale on the bottleneck signal, not CPU by habit — a queue consumer scales on queue depth (KEDA), a latency-sensitive API might scale on RPS/latency (custom metric), CPU only when CPU is genuinely the saturating resource.
- One owner per axis — never two controllers on the same axis: KEDA creates an HPA (never both on one workload); VPA in recreate mode must not manage the same resource an HPA scales on. Horizontal for load, vertical for right-sizing — pick deliberately per workload.
- Plan for the disruption scaling causes — scale-down and node consolidation evict pods:
PDBs, graceful shutdown, and
do-not-disruptannotations for the genuinely interruption-intolerant are part of the autoscaling design, not an afterthought. - Homelab/bare-metal reality check — node autoscaling presumes an elastic provider; on fixed hardware the node layer is capacity planning, and only the workload layer applies.
- GitOps the config — HPA/VPA/ScaledObject/NodePool are declarative and belong in git.
- Verify read-only —
kubectl describe hpa(events show every decision and its metric reading),kubectl get scaledobject, KEDA operator logs,kubectl get nodeclaims/ cluster-autoscaler status ConfigMap, and Pending-pod events for the node layer.
References
references/workload-autoscaling.md— HPA metrics/behavior math and failure modes, VPA modes and the HPA conflict, KEDA scalers/activation/scale-to-zero.references/node-autoscaling.md— cluster-autoscaler vs Karpenter decision table, NodePool/consolidation/disruption design, protection annotations.
Safety rules
- Design/review skill: do not apply HPA/VPA/ScaledObject/NodePool changes or delete/cordon nodes on a live cluster — propose manifests for review.
- Scale-down settings are eviction settings — aggressive consolidation or a missing PDB turns "optimize cost" into an availability incident; frame scale-down changes with their disruption blast radius.
- Never propose disabling autoscaling (or pinning replicas) as a quick fix for thrashing — tune stabilization/policies against the observed oscillation instead.
- Scale-to-zero means cold starts and (for queues) latency until activation — call the trade-off out explicitly wherever it's proposed.
- Cloud credentials for KEDA scalers and Karpenter are secrets — reference a secrets mechanism
(
secrets-management), never inline.
Output format
## Layer & baseline (requests honest? metric source? current scalers? node groups/provider)
## Recommendation (what scales on what signal, and explicitly what NOT to add)
## Prerequisites & blast radius (metrics pipeline, PDBs, disruption settings)
## Proposed config (HPA/ScaledObject/NodePool manifests — for review)
## Rollout & rollback
## Verification (read-only: describe hpa events, nodeclaims, Pending-pod events)Quality checklist
- Resource requests were verified honest before any scaling math
- The scaling signal matches the actual bottleneck, not CPU-by-default
- No axis has two owners (KEDA vs HPA, VPA-recreate vs HPA on the same metric)
- Disruption is designed: PDBs / graceful shutdown / do-not-disrupt where warranted
- Node-layer advice matches the environment (elastic cloud vs fixed hardware)
- Nothing was applied to a live cluster; verification is read-only
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

