What happened:
kubectl drain --disable-eviction --dry-run=server target-node hangs indefinitely when there are pods on the target node.
What you expected to happen:
The command should complete immediately without hanging, as it does with --dry-run=client or without --disable-eviction.
How to reproduce it (as minimally and precisely as possible):
# With kind multi-node cluster
kubectl apply -f pod.yaml (any pod manifest)
kubectl drain kind-worker --disable-eviction --ignore-daemonsets --dry-run=server
# Hangs here indefinitely
Anything else we need to know?:
I think it appears that the deletePods path (used when --disable-eviction is set) enters waitForDelete after sending the dry-run delete request, waiting for pods that are never actually removed.
https://github.com/kubernetes/kubernetes/blob/fbe282098364806aed50a44fa69bcd2a0fc2ad8b/staging/src/k8s.io/kubectl/pkg/drain/drain.go#L411
Environment:
- Kubernetes version: v1.35
- OS: Linux
/sig cli
/kind bug
/area kubectl
/assign
What happened:
kubectl drain --disable-eviction --dry-run=server target-nodehangs indefinitely when there are pods on the target node.What you expected to happen:
The command should complete immediately without hanging, as it does with
--dry-run=clientor without--disable-eviction.How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
I think it appears that the
deletePodspath (used when--disable-evictionis set) enterswaitForDeleteafter sending the dry-run delete request, waiting for pods that are never actually removed.https://github.com/kubernetes/kubernetes/blob/fbe282098364806aed50a44fa69bcd2a0fc2ad8b/staging/src/k8s.io/kubectl/pkg/drain/drain.go#L411
Environment:
/sig cli
/kind bug
/area kubectl
/assign