kubernetes: [FG:InPlacePodVerticalScaling] Pod Resize - resize stuck in "InProgress"
What happened?
I am trying the the feature gate “InPlacePodVerticalScaling”. I tried on multiple environment/versions and the result is always the same. Resize is forever stuck in “InProgress”.
I followed the doc: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/
What did you expect to happen?
Resize field in pod status should go to complete
How can we reproduce it (as minimally and precisely as possible)?
Follow this doc: https://kubernetes.io/docs/tasks/configure-pod-container/resize-container-resources/
Anything else we need to know?
No response
Kubernetes version
I tested with kubernetes version 1.27 and 1.29 with the same result. containerd version being v1.6.28.
The 2 requirements being (from my understanding): kubernetes >=v1.27 containerd >=v1.6.9
Cloud provider
I tried on GKE and locally with Minikube
OS version
mac sonoma 14.1.2 (m1)
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 22 (17 by maintainers)
The kubelet actually never touches the resize status field. The only reference is in PrepareForUpdate in the API server, which sets it toInProgress. It looks like this portion of the KEP was never really implemented.EDIT: I don’t know why I thought that was the case… I must have been looking at the wrong version of the code. The status should be set here: https://github.com/kubernetes/kubernetes/blob/c6b5191c37f939d2d61e76de222a96ae5f5d9558/pkg/kubelet/kubelet.go#L2864-L2872
I hit a similar issue when I reproduced #124786. In this case, I set a too small value to the memory limit. Then, I hit the following error and the pod resize status got stuck in “InProgress”: https://github.com/kubernetes/kubernetes/blob/b5bc8025be6179ff49ea2edf654a6b855ae00119/pkg/kubelet/kuberuntime/kuberuntime_manager.go#L743
I guess you also hit one of failures in this doPodResizeAction(). In this case, you could see what happened only in the kubelet log.
In order to make the failures visible to users, more work seems necessary around
PodSyncResultandReasonCache: https://github.com/kubernetes/kubernetes/blob/b5bc8025be6179ff49ea2edf654a6b855ae00119/pkg/kubelet/kubelet.go#L1977-L1978 Emitting events might be another option.After hitting a failure here, the pod worker retries to resize the pod periodically at regular resyncing because no error is returned: https://github.com/kubernetes/kubernetes/blob/b5bc8025be6179ff49ea2edf654a6b855ae00119/pkg/kubelet/kubelet.go#L1989 https://github.com/kubernetes/kubernetes/blob/b5bc8025be6179ff49ea2edf654a6b855ae00119/pkg/kubelet/pod_workers.go#L1493-L1494 So, the pod gets stuck in
InProgress. I’m afraid I’m not sure whether this is an intended behavior or we should abort resizing because I haven’t dug this feature yet.I verified same thing by spinning up local cluster using k8s
hack/local-up-cluster.shand its works as expected and I dont see any Inprogress resize status even after updating the cpu, I followed the same steps from here.For reference Initially
Eventually