Deployment fails on Kubernetes worker node with containerd tmpmount unmount error during image pull
search cancel

Deployment fails on Kubernetes worker node with containerd tmpmount unmount error during image pull

book

Article ID: 433895

calendar_today

Updated On:

Products

VMware vSphere Kubernetes Service

Issue/Introduction

  • A deployment fails repeatedly when workload pods are scheduled on a specific Kubernetes worker node. The deployment fails during image pull and layer extraction with an error similar to:

    ERROR: Job failed: prepare environment: waiting for pod running: pulling image "docker.domain.com/external/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-######": image pull failed: failed to pull and unpack image "docker.domain.com/external/gitlab-org/gitlab-runner/gitlab-runner-helper:x86_64-######": failed to extract layer sha256:<digest>: failed to unmount /var/lib/containerd/tmpmounts/containerd-mount15044####: failed to unmount target /var/lib/containerd/tmpmounts/containerd-mount15044####: device or resource busy: unknown
  • Deployments fail only when scheduled on one specific worker node.

  • Image pull starts successfully but fails during layer extraction or unpacking.

  • Stale temporary mounts remain under /var/lib/containerd/tmpmounts/.

  • Cordoning the affected node allows deployments to succeed on alternate nodes.

Environment

vSphere Kubernetes Release

Cause

The containerd runtime is unable to clean up temporary mounts created under /var/lib/containerd/tmpmounts/ during image layer extraction when the unmount operation fails with a device or resource busy error.

Resolution

    1. Log into the affected worker node via SSH.

    2. Verify whether stale containerd temporary mounts exist on the node:

      mount | grep containerd/tmpmounts
      findmnt | grep containerd/tmpmounts
      cat /proc/self/mountinfo | grep containerd/tmpmounts
      
    3. Check whether active processes or containerd are holding the temporary mount open:

      lsof +D /var/lib/containerd/tmpmounts 2>/dev/null
      fuser -vm /var/lib/containerd/tmpmounts
      
    4. Cordon the impacted worker node:

      kubectl cordon <node-name>
      
    5. Drain active workloads from the node:

      kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data
      
    6. Restart containerd and kubelet services on the affected node:

      systemctl restart containerd
      systemctl restart kubelet
      
    7. Confirm that stale temporary mounts have been removed:

      mount | grep containerd/tmpmounts
      
    8. Test manual image extraction:

      crictl pull <image-name>
      
    9. Once the pull succeeds and no stale mounts remain, uncordon the worker node:

      kubectl uncordon <node-name>
      

Additional Information

  • The presence of entries under /var/lib/containerd/tmpmounts/ after image pull failure indicates that cleanup did not complete successfully. For example, stale mounts may appear similar to:
    • /var/lib/containerd/tmpmounts/containerd-mount18313####
    • /var/lib/containerd/tmpmounts/containerd-mount112892####
  • These mounts may map to deleted overlay snapshot paths, which indicates that containerd created the temporary mount during image unpack but failed to remove it afterward.
  • If the deployment succeeds after the node is cordoned, the failure is isolated to the worker node and its container runtime state.
  • Recommended additional validation on the affected node:
    • journalctl -u containerd -n 200 --no-pager
    • journalctl -u kubelet -n 200 --no-pager
    • df -h
    • df -i
    • dmesg -T | egrep -i "containerd|overlay|ext4|xfs|I/O|error"
    • ps -ef | grep containerd
  • Potential contributing factors include:
    • stale container runtime state on the worker node

    • interrupted image extraction

    • filesystem or overlay mount issues

    • third-party host software interacting with container runtime temporary mount paths