Headroom reduction deploys new nodes much faster than other autoscalers with large-scale node hibernation and re-activation reducing the need for buffer.
The following video shows how Headroom reduction reduces the need for an overallocated node buffer:
The magic behind the scenes
When you activate Headroom reduction on a workload, the following automatic steps ensure protection:
Hibernated nodes begin warming up. Kompass listens to the unscheduled Pods pool.
When Kompass determines that there are unscheduled Pods in the pool, Kompass deploys pre-baked, hibernated nodes to respond to spikes.
At the same time, the autoscaler launches new nodes.
When the Kompass nodes are ready to host Pods, the unscheduled Pods are scheduled to the Kompass nodes.
Kompass assigns a negative deletion cost to those Pods (using the pod-deletion-cost annotation), and they continue to run until they are deleted.5 minutes after being reactivated, Kompass hibernated nodes are cordoned.
Every 5 minutes, Kompass checks which Pods have not yet been deleted and duplicates those Pods that are still running on its nodes.
When the autoscaler nodes are ready to host Pods, the duplicated Pods are schedule to the autoscaler nodes.
After a few minutes, HPA deletes the Pods running on the Kompass nodes based on their lower deletion cost), then and Kompass drains its nodes and returns them to hibernation.
The following diagram illustrates the process: