How to use Vertical Pod Autoscaler to adjust Pod Resource levels

It’s complicated to find out good values for investigate and resolve fair use ratio violations for a project. APPUiO Cloud offers the OpenShift Vertical Pod Autoscaler (VPA) object to assist DevOps engineers to fine tune the requests and limits of their deployments.

This document explains how to use VPAs. It assumes that you have a working project with some payload deployed and running.


The VPA operator is provided in APPUiO Cloud with the following limitations:

  • The VPA operator only provides recommendations; it doesn’t recreate pods automatically with new request and limit values.

Create the VPA Object

Use the YAML below to define a new VPA object, and oc apply it to your namespace.

kind: VerticalPodAutoscaler
  name: vpa-recommender
    apiVersion: "apps/v1"
    kind:       Deployment
    name:       vpa-example  (1)
    updateMode: "Off" (2)
1 Specify here the name of your deployment.
2 The VPA is deployed to only support recomendation mode. So Off is the only supported value there.

Find Recommendations

The VPA requires a few moments to gather data and provide recommendations from it. After some time, during which your deployment should have been running in order to gather meaningful data, run the following command and you should see output similar to this in your terminal:

$ oc get vpa vpa-recommender --output yaml
kind: VerticalPodAutoscaler
  annotations: …
# …
    apiVersion: apps/v1
    kind: Deployment
    name: vpa-example
    updateMode: Auto
  - status: "True"
    type: RecommendationProvided
    - containerName: fortune-container
        cpu: 25m
        memory: 262144k
      target: (1)
        cpu: 203m
        memory: 262144k
        cpu: 203m
        memory: 262144k
      upperBound: (2)
        cpu: 71383m
        memory: "6813174422"
1 Use this value as request in your deployment.
2 Consider using this value as limit in your deployment. Analyze the reported upperBound carefully before using it as the limit in your deployment. The recommender will start with a very high upper bound, and update it over time as it observes the running application.

Interpreting the Recommendations

You should analyze with care the values provided by the autoscaler for your deployment. Don’t blindly apply its recommendations; let your application run for a while and study the numbers closely.

Some tips for your analysis:

  • The status.recommendation.containerRecommendations[*].target value could be considered indicative for request values.

  • The status.recommendation.containerRecommendations[*].upperBound value could be used as an indication to set limit values.

  • The OpenShift dashboard explained in this page shows utilization numbers for both CPU and memory limits. Those values function as a suitable supplementary information source.