kubernetes: Pods are in Running, Terminating state even after the expiry of shutdownGracePeriod during Graceful Node Shutdown

What happened?

I have configured shutdownGracePeriod to enable graceful shutdown feature in k8s 1.24 beta. When the node is under graceful shutdown, there are few pods which are in Running state and few are in Terminating state.

What did you expect to happen?

As the node got graceful shutdown, the pods should be moved out of the node and there should not be any pods in the node which was already shutdown.

How can we reproduce it (as minimally and precisely as possible)?

Flags configured: shutdownGracePeriod:30s, shutdownGracePeriodCriticalPods:10s, --terminated-pod-gc-threshold: 1 Shutdown the worker node gracefully (with systemctl poweroff).

  1. Few deployment pods are in Running state. After 5 minutes it is moving to Terminating state. (nginx)
  2. Daemonset pods are in pending state (https://github.com/kubernetes/kubernetes/issues/109450 behavior)
  3. One of the Daemonset pod continues to be in Running state for ever. (subport-manager)

eccd@director-0-stack:~> kubectl get pods -A -o wide | grep worker-pool1-i1oiwd5d-stack ingress-nginx nginx-ingress-controller-58744fc4c9-m2r5t 1/1 Terminating 0 144m 192.168.138.131 worker-pool1-i1oiwd5d-stack <none> <none> kube-system calico-node-69hxh 0/1 Pending 0 11m <none> worker-pool1-i1oiwd5d-stack <none> <none> kube-system kube-proxy-445sv 0/1 Pending 0 11m <none> worker-pool1-i1oiwd5d-stack <none> <none> kube-system node-local-dns-88zgn 0/1 Pending 0 11m <none> worker-pool1-i1oiwd5d-stack <none> <none> kube-system subport-manager-bbhxr 1/1 Running 0 151m 10.0.16.27 worker-pool1-i1oiwd5d-stack <none> <none>

Anything else we need to know?

No response

Kubernetes version

$ kubectl version
eccd@director-0-ejlnoox-ibd-stack:~> kubectl version
WARNING: This version information is deprecated and will be replaced with the output from kubectl version --short.  Use --output=yaml|json to get the full version.
Client Version: version.Info{Major:"1", Minor:"24+", GitVersion:"v1.24.0-beta.0", GitCommit:"3794d751af1baf8ea5158effa1ac1ac308cc4420", GitTreeState:"clean", BuildDate:"2022-03-31T17:59:42Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"24+", GitVersion:"v1.24.0-beta.0", GitCommit:"3794d751af1baf8ea5158effa1ac1ac308cc4420", GitTreeState:"clean", BuildDate:"2022-03-31T17:49:49Z", GoVersion:"go1.18", Compiler:"gc", Platform:"linux/amd64"}
eccd@director-0-ejlnoox-ibd-stack:~>

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, …) and versions (if applicable)

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 1
  • Comments: 17 (5 by maintainers)

Most upvoted comments

@ehashman @bobbypage We are continuously seeing this issue in both 1.24.1 and 1.25. Also we have tested with increasing the value of shutdownGracePeriod and shutdownGracePeriodCriticalPods. But getting the same behavior, deployment pod is in terminating stage and kube-system pods are in pending state. Any recommendation for a fix please.