We have built k8s using kubeadm
and setup 3 nodes machines (which we have root access to)
We want to use the feature of k8s that they call according to their docs “pre-pull images” which is that pods that will be created on nodes – will use the local docker images vs the public internet.
Problem is it’s not working.
Running the following on all nodes – will have the same result
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
busybox latest 65ad0d468eb1 12 months ago 4.26MB
mybusybox latest 65ad0d468eb1 12 months ago 4.26MB
I tagged the busybox
just to make sure that the pod isn’t taking the busybox image from docker hub.
So i’m trying to run k8s with the following:
kubectl run hello-world-0 -ti --image=mybusybox --image-pull-policy=Never --restart=Never
When running kubectl describe hello-world-0
I see that it got assigned to a node that i’m 100% sure the image exists on ( per output above )
But I’m receiving the following error
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 2m33s default-scheduler Successfully assigned ns-test/hello-world-0 to ip-172-x-x-x.europe.compute.internal
Warning Failed 32s (x12 over 2m32s) kubelet Error: ErrImageNeverPull
Warning ErrImageNeverPull 19s (x13 over 2m32s) kubelet Container image "mybusybox" is not present with pull policy of Never
I will just note, that also from the node itself when I try running:
node1$ sudo docker pull mybusybox
Using default tag: latest
Error response from daemon: pull access denied for mybusybox, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
but I’m not really sure if this error is related to the error that k8s receive in the pods ?
We never configured any credentials, we just installed docker so i’m not sure that the login is the issue …
Appreciate any help here …