In-Place Pod Resource Resize: Adjust CPU and Memory Without Restarts
Briefly

In-Place Pod Resource Resize: Adjust CPU and Memory Without Restarts
"a sudden traffic spike arises creating an urgent need to adjust CPU and memory resources. The solution? Vertical Pod Autoscaler (VPA) springs into action - but it has to recreate every pod to apply the changes. The result: connection drops, service interruptions, and frustrated users. For years, Kubernetes developers have dealt with a frustrating limitation: adjusting pod resources meant destroying and recreating pods."
"For stateful workloads its even more painful and that changes with K8s 1.35 . In-Place Pod Resource Resize (now GA/stable) - allows CPU and memory adjustments without pod recreation Let's write some code to see the first feature i.e. In-Place Pod Resource Resize minikube start --kubernetes-version=v1.35.0 apiVersion: v1kind: Podmetadata: name: resize-demospec: containers: - name: web-container image: nginx resources: requests: cpu: "200m" memory: "256Mi" limits: cpu: "500m" memory: "512Mi" resizePolicy: - resourceName: "cpu" restartPolicy: "NotRequired" - resourceName: "memory" restartPolicy: "NotRequired" kubectl apply -f resize-demo.yaml"
Kubernetes 1.35 delivers GA In-Place Pod Resource Resize that allows CPU and memory changes without destroying and recreating pods. Previously, the Vertical Pod Autoscaler required pod recreation to apply resource adjustments, causing connection drops and service interruptions, particularly for stateful workloads. In-place resizing uses resizePolicy entries and restartPolicy: NotRequired to modify container requests and limits without restarting. The example shows starting minikube with v1.35.0 and applying a pod manifest that declares requests, limits, and resizePolicy for cpu and memory. The feature reduces downtime and avoids user-facing interruptions during resource scaling.
Read at Medium
Unable to calculate read time
[
|
]