Based on the official docs and the Banzai Cloud blog post by Toader Sebastian.
Environment:
$ minishift version
minishift v1.21.0+a8c8b37
$ kubectl version --short
Client Version: v1.9.1
Server Version: v1.9.1+a0ce1bc657
$ minishift start --cpus=4 --memory=4GB
$ oc login -u system:admin
Get VPA bits and set it up:
$ git clone https://github.com/kubernetes/autoscaler.git
$ cd autoscaler/vertical-pod-autoscaler
$ ./hack/vpa-up.sh
Expect now to see the following:
$ kubectl get po -n kube-system
NAME READY STATUS RESTARTS AGE
vpa-admission-controller-6b758d8678-9kddd 1/1 Running 0 55s
vpa-recommender-5dfc7669f7-m44vg 1/1 Running 0 58s
vpa-updater-5d596b7897-gm9zx 1/1 Running 0 58s
$ kubectl get crd
NAME AGE
verticalpodautoscalercheckpoints.poc.autoscaling.k8s.io 1m
verticalpodautoscalers.poc.autoscaling.k8s.io 1m
Note: Prometheus must be deployed into the monitoring
namespace with a service named prometheus
pointing to it. Using Prometheus for OpenShift standalone as the basis.
$ oc new-project monitoring
$ oc create secret generic prom --from-file=prometheus/prometheus.yml
$ oc process -f prometheus/app.yaml | oc apply -f -
$ oc new-project vpa-demo
$ kubectl apply -f test/app.yaml
$ kubectl apply -f test/vpa.yaml