Kubernetes HPA Config Generator
Build a production-ready HorizontalPodAutoscaler YAML visually.
Configure API version, target deployment, CPU/memory metrics, custom metrics, and fine-grained scale behavior — then copy the YAML or kubectl commands instantly.
Frequently Asked Questions
What is a Kubernetes HorizontalPodAutoscaler (HPA)?▼
A HorizontalPodAutoscaler automatically scales the number of Pod replicas in a Deployment, ReplicaSet, or StatefulSet based on observed metrics — most commonly CPU or memory utilization. When demand spikes, the HPA increases the replica count up to your maxReplicas limit; when traffic drops, it scales back down to minReplicas. The HPA controller runs in the Kubernetes control plane and queries metrics every 15 seconds by default.
What is the difference between autoscaling/v2 and autoscaling/v1?▼
autoscaling/v1 is the original API and only supports CPU utilization via targetCPUUtilizationPercentage. autoscaling/v2 (stable since Kubernetes 1.23) supports multiple metric types simultaneously: Resource metrics (CPU/memory by Utilization % or AverageValue), Pods metrics (per-pod custom metrics), Object metrics (metrics tied to Kubernetes objects like Ingress), and External metrics (from outside the cluster). v2 also adds the behavior block for fine-grained scale-up/scale-down control. Use v2 for any new workloads.
When should I use Utilization vs AverageValue for CPU metrics?▼
Use Utilization (%) when you want to target a percentage of the Pod's CPU request — e.g., targetAverageUtilization: 80 means the HPA will scale when average CPU across all pods exceeds 80% of their request. Use AverageValue when you want to target an absolute value like 500m (millicores) per pod. Utilization requires CPU requests to be set on the container spec; if requests are missing, the HPA cannot calculate utilization and will report unknown metrics.
What does the stabilizationWindowSeconds setting do?▼
The stabilization window prevents flapping — rapid scale-up followed immediately by scale-down (or vice versa). For scale-down, the default is 300 seconds: the HPA will look back over the last 5 minutes of metric history and only scale down to the highest recommendation it saw during that window. For scale-up, the default is 0 seconds (scale up immediately). Increasing the scale-up stabilization window is useful for workloads with spiky traffic where you want to avoid over-provisioning on transient bursts.
What are HPA scale policies and how do they work?▼
Scale policies (autoscaling/v2 behavior block) limit how fast the HPA can scale. A policy has three fields: type (Percent or Pods), value (how many or what percentage to change), and periodSeconds (over what time window). For example, type: Percent, value: 100, periodSeconds: 60 means at most double the current replicas per minute. You can define multiple policies; selectPolicy: Max picks the policy that allows the largest change, Min picks the most conservative. This prevents runaway scaling during sudden traffic spikes.
What metrics server do I need for HPA to work?▼
For Resource metrics (CPU/memory), you need the Kubernetes Metrics Server installed in your cluster — it is not included by default. Install it with: kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml. For custom metrics (Pods/Object types), you need a custom metrics adapter such as Prometheus Adapter configured to expose metrics via the custom.metrics.k8s.io API. Cloud-managed clusters (GKE, EKS, AKS) typically include the metrics server out of the box.
Related Products
on GumroadPremium Workflow Pack
Production-grade workflows, architecture guides, and deployment scripts for teams that ship. 10 advanced CI/CD workflows (blue-green, canary, E2E, security), 5 architecture deep-dives, code review checklist, PR process guide, and 5 battle-tested Bash deployment scripts.
Buy on Gumroad →GitHub Actions CI/CD Templates Pack
12 production-ready GitHub Actions workflow templates covering Node.js, Python, Docker, multi-environment deployments, security scanning, and auto-changelog. Copy, paste, ship.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
Kubernetes Resource Estimator
Estimate total Kubernetes cluster CPU and memory requirements. Input pods, replicas, and resource requests/limits to get cluster totals, requests vs limits analysis, and a ready-to-use ResourceQuota YAML.
Open free tool →
Kubernetes Resource Calculator
Calculate total CPU and memory requirements for your Kubernetes workloads. Input resource requests and limits per pod, replica count, and get cluster resource usage with cloud cost estimates.
Open free tool →
Kubernetes Resource Calculator
Calculate K8s resource requests and limits. Input CPU cores, memory per pod, replica count. Output cluster resource needs, HPA config, namespace quota YAML.
Open free tool →
More Free Tools
Related Articles
Pulumi vs Terraform 2026: Which IaC Tool Should You Choose?
A deep comparison of Pulumi and Terraform for infrastructure as code in 2026. Covers syntax, state management, provider ecosystem, team adoption, and when to choose each tool.
AWS CDK vs Terraform vs Pulumi: Infrastructure as Code Comparison 2026
Complete comparison of AWS CDK, Terraform, and Pulumi for infrastructure as code in 2026 — language support, state management, multi-cloud, community, and when to use each.
Docker Compose vs Kubernetes for Small Teams 2026
Should small teams use Docker Compose or Kubernetes in 2026? Compare production viability, K3s as a middle ground, Kompose migration, and the real costs of managed Kubernetes for teams under 20.
Docker Compose vs Kubernetes: When to Use Each (2026)
A practical guide to choosing between Docker Compose and Kubernetes in 2026. Compare complexity, use cases, cost, and learn when to migrate from one to the other.
Kubernetes Cost Optimization: A Practical Guide for 2026
Reduce your Kubernetes costs by 40-60% with rightsizing, VPA/HPA, spot instances, namespace quotas, and cost monitoring tools like Kubecost. Real examples included.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →