How to Use In-Place Pod-Level Vertical Scaling in Kubernetes v1.36

By

Introduction

Kubernetes v1.36 brings a powerful new capability: In-Place Pod-Level Vertical Scaling. Now in Beta and enabled by default, this feature lets you adjust the aggregate resource budget for a running Pod without necessarily restarting its containers. This guide walks you through everything you need to know to leverage this feature—from understanding the basics to executing a live resize on your cluster.

How to Use In-Place Pod-Level Vertical Scaling in Kubernetes v1.36

What You Need

Step-by-Step Guide

Step 1: Understand the Feature

In-Place Pod-Level Vertical Scaling allows you to modify the spec.resources field of a running Pod—the aggregate CPU and memory pool shared by all containers. Previously, you could only change per-container limits (which often required restarts). Now you can boost the overall Pod budget on the fly, and containers that inherit their limits from the Pod level will automatically expand their effective bounds. This is ideal for Pods with sidecars where you want to avoid manual per-container recalculations.

Step 2: Verify Your Cluster Version and Feature Gate

Ensure your cluster runs Kubernetes v1.36 or later. Check with:

kubectl version --short

Confirm the feature gate is enabled:

kubectl get nodes -o yaml | grep InPlacePodLevelResourcesVerticalScaling

If you see true (or the gate isn't listed, which means it's enabled by default), you're good to go.

Step 3: Define a Pod with Pod-Level Resources

Create a Pod that specifies resources at the Pod level, not per container. Below is an example YAML with a shared 2 CPU pool:

apiVersion: v1
kind: Pod
metadata:
  name: shared-pool-app
spec:
  resources:
    limits:
      cpu: "2"
      memory: "4Gi"
  containers:
  - name: main-app
    image: nginx
    # No per-container limits – inherits from Pod level
    resizePolicy:
    - resourceName: cpu
      restartPolicy: NotRequired
  - name: sidecar
    image: nginx
    resizePolicy:
    - resourceName: cpu
      restartPolicy: NotRequired

Apply it:

kubectl apply -f pod-shared.yaml

Step 4: Understand Resource Inheritance and resizePolicy

When you initiate a Pod-level resize, the Kubelet treats the change as a resize event for every container that inherits its limits from the Pod budget. The resizePolicy at the container level determines whether a restart is needed:

Currently, resizePolicy is not supported at the Pod level; it must be defined on each container. Tip: Use NotRequired for most workloads to avoid disruption.

Step 5: Perform an In-Place Resize

To double the CPU from 2 to 4 for the running Pod, use the resize subresource:

kubectl patch pod shared-pool-app --subresource resize --patch '{"spec":{"resources":{"limits":{"cpu":"4"}}}}'

Note: The resize subresource is separate from the standard Pod update endpoint. It triggers the in-place resizing logic.

Once the patch is applied, the Kubelet checks node feasibility and follows a safety sequence:

  1. Feasibility check: Ensures the node can accommodate the new total request.
  2. Container-level evaluation: For each container that inherits the Pod resource, the Kubelet applies the appropriate resize policy.
  3. Resource update: Cgroups are updated (or container restarted) as needed.

If the node doesn't have enough spare capacity, the resize will fail with an error.

Step 6: Verify the Resize

Check the Pod's updated resource status:

kubectl describe pod shared-pool-app

Look for the Resources section at the Pod level – it should show the new CPU limit. You can also monitor container resource usage with kubectl top pod shared-pool-app (requires metrics server).

If any container had restartPolicy: RestartContainer, you'll see a container restart event in kubectl get events.

Tips for Success

Tags:

Related Articles

Recommended

Discover More

Go 1.25 Introduces Green Tea: A New Experimental Garbage CollectorYour Ultimate Guide to April 2026 Community Wallpapers: Download, Set, and ShareHow to Navigate the Petroleum System's Volatile Decline Phase6 Key Facts About Apple's Billion-Dollar Tariff Refund and US Manufacturing BoostSupply Chain Attack on Popular Machine Learning Package Exposed User Credentials