Skip to content

HPA-VPA incompatibility

HPA-VPA incompatibility refers to the operational conflict that arises when the Horizontal Pod Autoscaler (HPA) and the Vertical Pod Autoscaler (VPA) are configured to manage resources for the same set of pods simultaneously.^[400-devops-06-kubernetes-k8s-ithelp-day27-readme.md]

Cause of Conflict

The incompatibility stems from the way VPA operates in its default modes. When VPA is set to Auto or Recreate mode, it actively adjusts the requests and limits of a Pod's containers^[400-devops-06-kubernetes-k8s-ithelp-day27-readme.md]. Since HPA typically scales the number of Pod replicas based on the ratio of current resource usage to these defined requests, any modification made by VPA directly changes the calculation metric for HPA^[400-devops-06-kubernetes-k8s-ithelp-day27-readme.md]. This interaction creates a feedback loop that can lead to unpredictable scaling behavior or instability.

Operational Risks

Using VPA in Auto mode alongside HPA can result in severe issues, including the possibility of "extreme oscillation" in the number of replicas^[400-devops-06-kubernetes-k8s-ithelp-day27-readme.md].

Best Practices

To mitigate these risks while still utilizing both tools, it is recommended to use VPA in Off mode when HPA is active^[400-devops-06-kubernetes-k8s-ithelp-day27-readme.md]. In Off mode, the VPA will continue to monitor resource utilization and generate recommendations, but it will not automatically apply updates or evict pods^[400-devops-06-kubernetes-k8s-ithelp-day27-readme.md]. Administrators can then manually review the VPA recommendations to optimize their initial resource configurations without disrupting the HPA scaling logic.

Sources

^[400-devops-06-kubernetes-k8s-ithelp-day27-readme.md]