-
Notifications
You must be signed in to change notification settings - Fork 38.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Set TerminationMessagePath to a Path Under Bidirectional Mounted EmptyDir Blocking the Pod Deleting. #115054
Comments
/sig node storage |
/triage accepted this bug has enough details. If you can attach the whole kubelet.log it may help troubleshooting. /priority important-longterm |
@yuyue9284 why do you make the |
Hi @SergeyKanzhelev , sometimes we need to create mountpoint in one container and share the mountpoint to another container in the same pod using the bidirectional, we found only setting the |
Part of the kubelet logs.
|
I was able to reproduce this with master branch k8s and crio,
|
However, if I change the $ time kubectl delete -f pod.yaml
pod "test-pd" deleted
configmap "test-config" deleted
real 0m27.914s
user 0m0.035s
sys 0m0.013s So it seems like the volume manager is trying to delete the volume while the pod is still terminating and that volume is still in use by the terminating pod. |
kubernetes/pkg/kubelet/kuberuntime/kuberuntime_container.go Lines 420 to 424 in 703361f
|
terminationMessage writing should definitely block container volume unmounting. Where is that being written? By CRI? |
apiVersion: v1
kind: ConfigMap
metadata:
name: test-config
data:
test.sh: |
#!/bin/bash
trap "echo 'SIGTERM received, gracefully shutting down'; echo 'shutdown logs...' > /cache/log.txt; exit 0" SIGTERM
for i in {1..100000000}
do
echo "test $i"
sleep 1
done from the pod yaml in the description, |
I just meant, is there any chance the container write to the volume is doing something unusual such that the OS thinks the volume is still busy even though the container is stopped? If not, the question would be whether the kubelet is reading the volume post container stop that would cause this. There is a terminationMessagePath read in the status manager and the status manager is asynchronous to the core pod loop. So this may be an unintentional race between kubelet unmounting and kubelet trying to read the message path to update status. |
That's a good pointer. Thanks. |
The bug surfaces only if you specify |
/assign |
@SergeyKanzhelev Do you know whom to approach in sig storage to explore this further? |
What happened?
I have a pod writing the termination message into an empty dir volume with bidirectional mount propagation, every time I delete the pod, the pod will stuck at terminating, and I have to do a force deletion. the logs of kubelet showing something like
What did you expect to happen?
The pod can be deleted without force deletion, and the mount point, empty directory on the node running the pod should be cleared.
How can we reproduce it (as minimally and precisely as possible)?
Apply the following yaml, and delete the pod.
Anything else we need to know?
No response
Kubernetes version
Cloud provider
OS version
Install tools
Container runtime (CRI) and version (if applicable)
Related plugins (CNI, CSI, ...) and versions (if applicable)
The text was updated successfully, but these errors were encountered: