Understanding the Default Behavior
By default, Kubernetes (v1.32 and later) replaces the existing Pod when you modify resource requests or limits in a Deployment. Consider the following deployment configuration:The In-Place Update Mechanism
To address the disruption from full Pod recreation, Kubernetes is developing an in-place update mechanism for Pod resources. This feature has been available in alpha since Kubernetes 1.27 and is not enabled by default. It is expected to transition to beta—and eventually be enabled by default—as it matures.Example of In-Place Update Manifest
Below is an example where the CPU resource is increased from “250m” to “1”. Thanks to the in-place update feature, this change can be applied without deleting the Pod:Configuring Resize Policies
The following manifest demonstrates a resize policy for the CPU resource, allowing an update without restarting the Pod:The in-place resizing feature currently supports only CPU and memory resources. Familiarize yourself with these constraints before implementation.
Limitations of In-Place Pod Resizing
It is important to note the following limitations with the current implementation of in-place resizing:- Only CPU and memory resources can be updated in place.
- Changes to Pod QoS classes and certain other attributes are not supported.
- Init containers and ephemeral containers are not eligible for in-place resizing.
- Resource requests and limits, once assigned to a container, cannot be shifted to another container.
- A container’s memory limit cannot be reduced below its current usage; if such a request is made, the resize operation will remain in progress until the new memory limit is achievable.
- Windows Pods are not supported by this feature.