Kubernetes Vertical Pod Autoscaler
5 min readOct 30, 2024
This YAML manifest defines a VerticalPodAutoscaler (VPA) for a Kubernetes Deployment
named nginx-deployment
. The Vertical Pod Autoscaler automatically adjusts the CPU and memory resource requests and limits of your pods based on observed usage, helping ensure efficient resource utilization.
Here’s a breakdown of the manifest:
YAML Breakdown:
apiVersion: autoscaling.k8s.io/v1
kind: VerticalPodAutoscaler
metadata:
name: nginx-vpa # Name of the VerticalPodAutoscaler
spec:
targetRef:
apiVersion: "apps/v1" # API version of the target resource
kind: Deployment # Target resource type (in this case, Deployment)
name: nginx-deployment # Name of the Deployment that the VPA is controlling
updatePolicy:
updateMode: "Auto" # Automatically update the pod resource requests and limits
Explanation of Key Fields:
apiVersion: autoscaling.k8s.io/v1
- The API version for the VerticalPodAutoscaler resource.
kind: VerticalPodAutoscaler
- The kind of resource being defined here is a VerticalPodAutoscaler.
metadata.name: nginx-vpa
- The name of the VerticalPodAutoscaler resource. In this case, it’s called
nginx-vpa
.