07. Autoscaling with CPU or Memory
Autoscaling with CPU or Memory
If you did the Scaling Demo earlier, you already saw one way to scale your apps:
kubectl scale {deployment name} --replicas={desired number of replicas}
The Horizontal Pod Autoscaler does this work for you.
ND#9991 C04 L04 A04 Autoscaling With CPU Or Memory
The Horizontal Pod Autoscaler built into Kubernetes is incredibly useful for expanding the number of Pods available based on processing or memory needs. The underlying algorithm itself, somewhat simplified, is as follows:
newNumPods = ceil(currentNumPods * (currentMetric / desiredMetric))
This means, if by some metric, we are currently at 2.5X our desired metric level, we will scale up our number of pods by 2.5X, rounded up to the nearest one pod.
Autoscaling Quiz