Description
Description
When running a pod with a certain image under containerd-cri the image pull fails. It appears this is due to
Nov 19 16:12:00 kind-control-plane containerd[136]: time="2020-11-19T16:12:00.140053300Z" level=warning msg="reference for unknown type: application/octet-stream"
Steps to reproduce the issue:
- Create containerd based kubernetes cluster
(I usedgit clone https://github.com/kubernetes-sigs/kind && cd kind && git checkout aebedcf8f4bf68a139b9572c0f18656cc1a9e429 && make build && bin/kind create cluster
) - Create a pod using
redis:2.8.23
(kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/redis-master-controller.json
) - Observe failure to pull image
(kubectl describe po
)
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Warning FailedScheduling 2m50s (x2 over 2m50s) default-scheduler 0/1 nodes are available: 1 node(s) had taint {node.kubernetes.io/not-ready: }, that the pod didn't tolerate.
Normal Scheduled 2m30s default-scheduler Successfully assigned default/redis-master-8qcns to kind-control-plane
Normal Pulling 2m29s kubelet, kind-control-plane Pulling image "redis:2.8.23"
Warning Failed 2m26s kubelet, kind-control-plane Failed to pull image "redis:2.8.23": rpc error: code = NotFound desc = failed to pull and unpack image "docker.io/library/redis:2.8.23": failed to unpack image on snapshotter overlayfs: failed to extract layer sha256:4dcab49015d47e8f300ec33400a02cebc7b54cadd09c37e49eccbc655279da90: failed to get reader from content store: content digest sha256:51f5c6a04d83efd2d45c5fd59537218924bc46705e3de6ffc8bc07b51481610b: not found
Warning Failed 2m26s kubelet, kind-control-plane Error: ErrImagePull
Normal Pulled 11s (x11 over 2m26s) kubelet, kind-control-plane Container image "redis:2.8.23" already present on machine
Warning Failed 11s (x11 over 2m26s) kubelet, kind-control-plane Error: failed to create containerd container: error unpacking image: failed to extract layer sha256:4dcab49015d47e8f300ec33400a02cebc7b54cadd09c37e49eccbc655279da90: failed to get reader from content store: content digest sha256:51f5c6a04d83efd2d45c5fd59537218924bc46705e3de6ffc8bc07b51481610b: not found
- Make sure the cluster is in a clean state
(I usedbin/kind delete cluster && bin/kind create cluster
) - On the node, manually pull to the Kubernetes/CRI namespace
(docker exec kind-control-plane ctr -n=k8s.io images pull docker.io/library/redis:2.8.23
) - Create the pod again
(kubectl apply -f https://raw.githubusercontent.com/kubernetes/examples/master/guestbook-go/redis-master-controller.json
) - Observe success
(kubectl describe po
)
This is repeatable, and repros what @justinsb originally found on kops/aws with containerd 1.4.1.
What's especially odd here is how it succeeds under manual pull with ctr but not when leaving the pull up to CRI.
Describe the results you received:
Image failed to pull successfully under CRI.
Describe the results you expected:
Image pull should succeed.
Image should pull successfully (appears to work on docker).
Output of containerd --version
:
containerd github.com/containerd/containerd v1.4.0-106-gce4439a8 ce4439a8151f77dc50adb655ab4852ee9c366589
Any other relevant information:
When doing the pull you will see a warning about a layer, in the containerd logs under CRI you see:
Nov 19 16:11:56 kind-control-plane containerd[136]: time="2020-11-19T16:11:56.975489200Z" level=info msg="PullImage \"redis:2.8.23\""
Nov 19 16:12:00 kind-control-plane containerd[136]: time="2020-11-19T16:12:00.140053300Z" level=warning msg="reference for unknown type: application/octet-stream" digest="sha256:481995377a044d40ca3358e4203fe95eca1d58b98a1d4c2d9cec51c0c4569613" mediatype=application/octet-stream size=5946
I see downstream users avoiding images with this issue, but sadly did not find an upstream bug so far.