K8s Vertical Pod Scalling (autoscale)

MD
R
Markdown

The Kubernetes Vertical Pod Autoscaler automatically adjusts the CPU and memory reservations for your pods to help "right size" your applications. This adjustment can improve cluster resource utilization and free up CPU and memory for other pods.

kubectl apply -f vpa-hamster.yaml kubectl describe vpa/hamster-vpa kubectl get --watch pods -l app=hamster

vpa-hamster.yaml


apiVersion: "autoscaling.k8s.io/v1beta2" kind: VerticalPodAutoscaler metadata: name: hamster-vpa spec: targetRef: apiVersion: "apps/v1" kind: Deployment name: hamster resourcePolicy: containerPolicies: - containerName: '*' minAllowed: cpu: 100m memory: 50Mi maxAllowed: cpu: 1 memory: 500Mi controlledResources: ["cpu", "memory"]

Created on 5/1/2020