Fix k8s containerd issue – “Error: failed to reserve container name”

A quick tips on how to fix Kubernetes pod when it fails with CreateContainerError status followed with “Error: failed to reserve container nameis reserved for …” described status by kubelet.

This issue is most likely caused by your Kubernetes node running with containerd.

Possible causes:

  • You have pre-cached in your k8s node image which has a broken layer. Re-build your k8s node image with a repaired image.
  • Example issue on Windows with pre-cached image:
amazon-ebs.windows: msg="apply failure, attempting cleanup" error="failed to extract layer sha256:... hcsshim::ImportLayer failed in Win32: The process cannot access the file because it is being used by another process. (0x20): unknown" key="extract-...sha256:..."
10:45:57   ==> amazon-ebs.windows: ctr: failed to extract layer sha256:...: hcsshim::ImportLayer failed in Win32: The process cannot access the file because it is being used by another process. (0x20): unknown
  • Your node does not have a suitable disk speed (low on IOPS). Try to increase the disk IOPS and throughput
  • Upgrade containerd to the latest available version

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.