VPA User's Guide#
VPA Resource Deployment#
A VPA resource has to be deployed for each Deployment, StatefulSet and DaemonSet. Below is a generic template which can be adapted:
apiVersion: autoscaling.k8s.io/v1beta2
kind: VerticalPodAutoscaler
metadata:
name: <name_of_vpa_resource>
namespace: <namespace>
spec:
targetRef:
apiVersion: "apps/v1"
kind: <Deployment|Statefulset|Daemonset>
name: <name_of_target_deployment>
updatePolicy:
updateMode: "Auto"
#### Optional section
resourcePolicy:
containerPolicies:
- containerName: "*"
minAllowed:
cpu: 300m
memory: 5Gi
maxAllower:
cpu: 4
memory: 20Gi
####
Verify VPA#
Check the recommendations#
- Get a list of VPA resources
kubectl -n <namespace> get vpa - Get detailes about a specific VPA resource
kubectl -n <namespace> get vpa <vpa_name> -o yaml
Check VPA logs#
VPA itself is deployed in the kube-system namespace.
Check evictions#
Using kubectl
kubectl -n kube-system logs vpa-updater-XXXXXX
Check karma#
Check karma to see if VPA did not cause any problems. Things to look for are memory and cpu warning.