can VPA and HPA(Auto Scaling) in kubernetes used together?

2.3k views Asked by At

**can the following be done : **

VPA relies on a number of different measurements and is different from the HPA. We can therefore use VPA without interference in relation to the HPA. For a truly efficient scaling, the HPA and VPA complement each other. HPA creates new replicas if the load raises. If the space for these replicas is not sufficient, VPA will provide some nodes, allowing HPA-made pods to run

can it use the same metrics? if we use metrics will both of it execute or do we need to define different metrics for both?

1

There are 1 answers

2
Piotr Malec On

I would also like to clarify one thing:

If the space for these replicas is not sufficient, VPA will provide some nodes, allowing HPA-made pods to run

If the number of nodes provided changes, it is horizontal scaling. Vertical scaling would mean changing the resource capacity of a node like number of cpus or amount of memory.


As for VPA working with HPA:

No, According to this article:

Avoid using HPA and VPA in tandem

HPA and VPA are currently incompatible and a best practice is to avoid using both together for the same set of pods. VPA can however be used with HPA that is configured to use either external or custom metrics.

AFAIK, k8s is better suited for HPA. K8s documentation also has HPA page.