The repo includes a set of Vertical Pod Autoscaler (VPA) recommenders pluggable with the default VPA on OpenShift 4.11+.
- Kubernetes 1.22+ or OpenShift 4.11
- Kubernetes Vertical Pod Autoscaler or OpenShift Vertical Pod Autoscaler Operator
- Enabling monitoring for user-defined projects (For OpenShift only)
-
Create an example workload and its VPA cr that uses default recommender.
oc apply -f manifests/examples/test-periodic-recommender.yaml
- Create a same workload managed by a VPA CR that uses the predictive recommender.
oc apply -f manifests/examples/pando-test-periodic-recommender.yaml
- Create a SA and corresponding rolebindings for the recommender to access the metrics.
oc apply -f manifests/openshift/recommender-sa.yaml
- Grant the recommender SA the permission to access the metrics.
oc adm policy add-cluster-role-to-user cluster-monitoring-view -z predictive-recommender -n openshift-vertical-pod-autoscaler
- Obtain the thanos-querier service to allow prometheus data access for the predictive VPA recommender.
PROM_SECRET=`oc get secret -n openshift-vertical-pod-autoscaler | grep predictive-recommender-token | head -n 1 | awk '{print $1 }'`
PROM_TOKEN=`echo $(oc get secret $PROM_SECRET -n openshift-vertical-pod-autoscaler -o json | jq -r '.data.token') | base64 -d`
PROM_HOST=`oc get route thanos-querier -n openshift-monitoring -o json | jq -r '.spec.host'`
Replace the PROM_TOKEN and PROM_HOST with their values in manifests/openshift/pando-recommender.yaml
.
Then, replace the ${DEFAULT_NAMESPACE}
by default
or any other namespace where the VPA is deployed.
- Deploy the predictive VPA recommender
oc create -f manifests/openshift/pando-recommender.yaml