skip to Main Content

I have an Apple Macbook Pro with an M1 chip, where I have a local kubernetes cluster running through Kind. The thing is I don’t understand how Kind deals with docker images from different platforms/architectures. The thing is I have an application installed via Helm that points to some docker images with linux/amd64 architecture, and when I install it through helm (helm install -n [namespace] [repo] [app]), it works like a charm (I can actually look at the downloaded images and see that their architecture is amd64). However, when I download the same image to my local docker registry with docker pull [my-image], and then try to load it to the kind cluster with kind load docker-image [my-image] [my-cluster], it doesn’t work and I get the following error:

Image: "[my-image]" with ID "sha256:d3a8..." not yet present on node "[my-cluster]-control-plane", loading...
ERROR: failed to load image: command "docker exec --privileged -i [my-cluster]-control-plane ctr --namespace=k8s.io images import --digests --snapshotter=overlayfs -" failed with error: exit status 1
Command Output: ctr: image might be filtered out

And after googling the error a little bit, I could see that it is due to the mismatch of architectures between the image and the kind cluster.

Could someone explain to me the reason for these different behaviors?

2

Answers


  1. Chosen as BEST ANSWER

    After asking in the Kind Slack channel in the Kubernetes workspace I could finally find the answer to my question: whole thread here.

    TL,DR; Kind was unable to load the images with architectures that don't match the host architecture because it lacked a required --all-platforms argument in the call to the ctr tool used by kind load docker-image to load the docker images into the cluster. A PR to fix the issue was filed and it will be fixed in future releases of Kind.


  2. This can also happen when you have to run kind as a super user

    Ensure to:

    • Check that the said image exists (docker images)
    • Run the command as sudo if required
    • Include image tag as part of the image
    • sudo kind load docker-image test-img:1.0 --name test-cluster
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search