Active1 year, 7 months ago
I have setup a new Kubernetes v1.5 cluster.
I locally created a new docker image using :
I'm getting the following error when trying to push to the Gitlab registry using gitlab-runner: unauthorized: authentication required ERROR: Build failed: exit status 1. I modified the pull to docker -D pull my-registry.com/my/container got. Login Succeeded DEBU[0000] Trusting 168 certs Pulling repository my-registry.
I created it using the command :
I can see that the image is avaiable and running :
Now I am trying to use the same image in a kubernetes deployment.
But doing so does not start the pod and I get the ERROR :
The files
/root/.docker/config.json
& /var/lib/kubelet/.dockercfg
are currently empty. Is there something Ive missed in setting up Kubernetes ? user4889345
1 Answer
Since you are building a custom docker image, you have to build it in every node of your cluster that the scheduler could put the pod into.
Furthermore, you need yo specify in your
PodSpec
an imagePullPolicy
of ifNotPresent
to indicate the kubelet
not to try to download your image if it is already present.This should make your image work, but I strongly suggest you to push your image in a
whites11whites11docker registry
and let the nodes pull it from there.5,0112 gold badges12 silver badges32 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.