Menu

1 / 5

Kubernetes HPA: How It Works and How to Stop Flapping

DEV Community: kubernetes·Michael Zion·14 days ago
#JakD0INZ
#devtokubernetes#devto#dev#pods#scale
Reading 0:00
15s threshold

This guide was written by Arthur Azrieli , CTO at MeteorOps, and first published on the MeteorOps blog .

Bottom line

The Kubernetes Horizontal Pod Autoscaler (HPA) adds or removes pod replicas for a Deployment, StatefulSet or other scalable workload based on a metric such as CPU utilization. Every 15 seconds it compares the current metric to your target, computes ceil(currentReplicas × current / target) , and scales within your minReplicas and maxReplicas .

That is the whole idea. Most of the trouble comes later, when replica counts start bouncing up and down, targets show <unknown> , or a GitOps tool keeps resetting the replica count.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.