Feedback

Chat Icon

Cloud-Native Microservices With Kubernetes - 2nd Edition

A Comprehensive Guide to Building, Scaling, Deploying, Observing, and Managing Highly-Available Microservices in Kubernetes

Autoscaling Microservices in Kubernetes: Vertical Scaling
54%

When to Use VPA Recommendations

Now that we have a deep understanding of how the VPA Recommender works, let's see a practical example. Change from Auto mode to Off mode and apply the VPA resource:

kubectl apply -f - <
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
  name: stateless-flask-vpa
  namespace: stateless-flask
spec:
    targetRef:
        apiVersion: "apps/v1"
        kind:       Deployment
        name:       stateless-flask
    updatePolicy:
        updateMode: "Off"
EOF

Describe the VPA resource:

kubectl describe vpa stateless-flask-vpa -n stateless-flask

The above command will output something like this:

[...]
Recommendation:
  Container Recommendations:
    Container Name:  stateless-flask
    Lower Bound:
      Cpu:     25m
      Memory:  250Mi
    Target:
      Cpu:     25m
      Memory:

Cloud-Native Microservices With Kubernetes - 2nd Edition

A Comprehensive Guide to Building, Scaling, Deploying, Observing, and Managing Highly-Available Microservices in Kubernetes

Enroll now to unlock all content and receive all future updates for free.