kubernetes: Pod is stuck in terminating with "MountVolume.SetUp failed for volume ... not registered" error
What happened?
Pod is stuck in terminating state when rapidly create and delete the pod, and the kubelet reported the volume setup error:
Oct 21 12:09:20 slave2 kubelet[4089]: E1021 12:09:20.197090 4089 nestedpendingoperations.go:348] Operation for "{volumeName:kubernetes.io/secret/dc79f107-6576-4d98-a120-23336154393e-tls-cert-vol podName:dc79f107-6576-4d98-a120-23336154393e nodeName:}" failed. No retries permitted until 2022-10-21 12:11:22.19703932 +0800 CST m=+323223.503182418 (durationBeforeRetry 2m2s). Error: MountVolume.SetUp failed for volume "tls-cert-vol" (UniqueName: "kubernetes.io/secret/dc79f107-6576-4d98-a120-23336154393e-tls-cert-vol") pod "vela-core-8494697c8c-xgrwt" (UID: "dc79f107-6576-4d98-a120-23336154393e") : object "cpaas-system"/"vela-core-admission" not registered
It has the same error with #105204, but the k8s 1.23.13 we used have fixed the issue with the PR #108756.
It appears that the PR haven’t totally fixed the issue. The cause may be if the pod is deleted when the volume manager is setting up the volume of the pod, the syncPod loop in kubelet won’t add the reference count because it’s in terminating state.
So the volume manager will still try to setup the volume of the pod but failed with the “not registed” error.
What did you expect to happen?
The pod should be deleted without the volume setup error.
How can we reproduce it (as minimally and precisely as possible)?
It’s the possibel reproduce steps:
- Create a pod with a configmap volume
- After the pod is created, delete the pod immediately
Maybe the steps should be runned several times.
Anything else we need to know?
No response
Kubernetes version
$ kubectl version
# paste output here
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: open
- Created 4 years ago
- Reactions: 1
- Comments: 15 (10 by maintainers)
@sharad740 that is a different mount error from the “not registered” issue.
@SergeyKanzhelev we’re hitting this issue somewhat frequently in large clusters and it seems to be one of the few sorts of issue like this where restarting kubelet does not resolve the problem and we have to force delete the pod.
This is on kubernetes v1.27.13
It seems to often happen for pods in the Terminating state for us and impacts all of the secret and configmap volumes, but no others.
I fixed my this error
by installing nfs-common in my worker node
Hope you don’t have such silly mistake