Kubernetes v1.36 Enhances Pod Resource Management with Beta In-Place Vertical Scaling

By

Introduction

The Kubernetes community continues to refine resource management for containerized workloads. Following the graduation of Pod-Level Resources to Beta in v1.34 and the General Availability (GA) of In-Place Pod Vertical Scaling in v1.35, version 1.36 brings another significant milestone: In-Place Pod-Level Resources Vertical Scaling has now reached Beta status. This feature is enabled by default via the InPlacePodLevelResourcesVerticalScaling feature gate, allowing users to dynamically adjust the aggregate resource budget of a running Pod—often without requiring a container restart. In this article, we delve into the mechanics, benefits, and practical implications of this enhancement.

Kubernetes v1.36 Enhances Pod Resource Management with Beta In-Place Vertical Scaling

Why Pod-Level In-Place Resize?

The Pod-level resource model simplifies management for complex Pods—such as those with sidecar containers—by enabling containers to share a collective pool of CPU, memory, and other resources. In v1.36, you can now modify this aggregate boundary on-the-fly, making it especially valuable for scenarios where individual containers lack explicit resource limits. When no per-container limits are defined, containers automatically inherit the Pod-level budget, allowing you to expand the shared pool during peak demand without manually recalculating limits for each container.

This capability reduces operational overhead and improves responsiveness to workload spikes. For example, a Pod containing a main application and a logging sidecar can dynamically receive more CPU during high traffic without interrupting either process.

Resource Inheritance and the resizePolicy

When a Pod-level resize is initiated, the kubelet treats the change as a resize event for every container that inherits its limits from the Pod-level budget. To decide whether a restart is necessary, the kubelet evaluates the resizePolicy defined within each container. Two policies are supported:

Currently, the resizePolicy is not supported at the Pod level; the kubelet always defers to individual container settings to determine if an update can be applied in-place or requires a restart.

Example: Scaling a Shared Resource Pool

Consider a Pod with a 2 CPU Pod-level limit and no per-container limits. The containers share this pool. Here’s how the initial specification might look:

apiVersion: v1
kind: Pod
metadata:
  name: shared-pool-app
spec:
  resources:
    limits:
      cpu: "2"
      memory: "4Gi"
  containers:
  - name: main-app
    image: my-app:v1
    resizePolicy:
    - resourceName: "cpu"
      restartPolicy: "NotRequired"
  - name: sidecar
    image: logger:v1
    resizePolicy:
    - resourceName: "cpu"
      restartPolicy: "NotRequired"

To double the CPU capacity to 4 CPUs, apply a patch using the resize subresource:

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

Because both containers have restartPolicy: NotRequired, the kubelet will attempt to update cgroups in-place, keeping the Pod running.

Node-Level Safety and Feasibility

Applying a resize patch is only the first step. The kubelet performs several checks to ensure node stability:

  1. Resource Availability: Verifies that the node has sufficient unused capacity to accommodate the new aggregate limits.
  2. Admission Control: Ensures the Pod’s scheduler request (if any) remains within the node’s allocatable resources.
  3. In-Place Update Feasibility: Checks the resizePolicy for each container to decide if a restart can be avoided.
  4. Eventual Consistency: If in-place updates fail (e.g., due to kernel limitations), the kubelet may fall back to a restart; otherwise, the resize is applied smoothly.

This sequence minimizes disruption while maintaining cluster stability, making Pod-level resource scaling a practical tool for production environments.

Conclusion

The graduation of In-Place Pod-Level Resources Vertical Scaling to Beta in Kubernetes v1.36 marks a significant step toward more flexible and efficient resource management. By allowing dynamic adjustments to the shared resource pool without mandatory container restarts, operators can respond to changing demands with minimal overhead. As the feature progresses toward General Availability, it promises to be a cornerstone for managing complex, multi-container Pods in modern Kubernetes clusters.

Related Articles

Recommended

Discover More

Mastering CSS justify-self: 7 Essential Insights for Web DevelopersQ&A: Apple and Porsche's Retro Race Car Collaboration at Laguna SecaCritical GitHub RCE Flaw Exposed Millions of Repos – Patch Now UrgedRansomware in 2025: Key Trends and Tactics in a Changing Threat EnvironmentMeet Vasuki Indicus: The Giant Prehistoric Snake That Rivals Titanoboa