Changing a Pod's resources used to mean replacing it. In-place Pod resize, stable since Kubernetes 1.35 5,150 , makes CPU and memory mutable through the Pod's resize subresource, and the kubelet rewrites the running container's cgroup:
kubectl patch pod guaranteed --subresource resize -p '{"spec": {"containers": [{"name": "c",
"resources": {"requests": {"cpu": "500m"}, "limits": {"cpu": "500m"}}}]}}' >/dev/null
sleep 3
kubectl get pod guaranteed -o jsonpath='{.status.containerStatuses[0].resources}{"\n"}'
kubectl get pod guaranteed -o jsonpath='{.status.containerStatuses[0].restartCount}{"\n"}'
kubectl exec guaranteed -- cat /sys/fs/cgroup/cpu.max
kubectl delete pod hog probes guaranteed --wait=false >/dev/nullOutput
{"limits":{"cpu":"500m","memory":"64Mi"},"requests":{"cpu":"500m","memory":"64Mi"}}
0
50000 100000No restart, and the quota doubled. The QoS class is fixed, so this Pod raised request and limit together; a resize the node cannot fit waits in a PodResizePending condition.