-2

I have a kubernetes cluster that has as container runtime the containerd.

As i have read the concept having as container run time instead of docker in Kubernetes doesnt change. So what i am trying to implement is to create a pod in my cluster using an image that i have build locally with docker build.

So when i have the image that i created locally :

REPOSITORY   TAG       IMAGE ID       CREATED             SIZE
app          latest    726b53fd88c1   About an hour ago   932MB

When i use the name of the image "app" in my deployment file sthe status of the pod is "ErrImagePull" with the following error:

Failed to pull image "app": rpc error: code = Unknown desc = failed to pull and unpack image "docker.io/library/app:latest": failed to resolve reference "docker.io/library/app:latest": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed

I thought that this happens because cotainerd doesnt recognises the image. Indeed when i run the command :

ctr images ls

there were no images. So i imported the image into containerdand now when i run the previous command i can see my image in containerd :

REF                          TYPE                                                 DIGEST                                                                  SIZE      PLATFORMS   LABELS 
docker.io/library/app:latest application/vnd.docker.distribution.manifest.v2+json sha256:9e12e07a860f91b713adbb9d5752aef364328afc468d1ccc1af6a31ca464fd78 910.5 MiB linux/amd64 -  

But when i use the ref of the image above in my doployment file still occurs the same error the i had.

How to use a local custom image with containerd in my kubernetes deployment?

Rodr
  • 31
  • 6

1 Answers1

0

Finally it seems that there is a specific namespace you have to import you image, "namespace=k8s.io". So if you import the image in this namespace, kubernetes recognises the image and runs the pod succesfully!

Rodr
  • 31
  • 6
  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jun 04 '22 at 05:47