How can i pull the images from gcr.io for kubeadm install

8/4/2017

I want to pull the images beforehand and then install kubeadm on my host. Currently my network blocks gcr.io. So can i pull the images beforehand and then connect my host to corporate network for the install?

-- NSP
kubeadm
kubernetes
networking

1 Answer

8/5/2017

It's hard to provide the perfect generic answer to your question without knowing more of the tradeoffs you are willing to endure, but the tl;dr may be:

# on a host with access:
docker pull gcr.io/google_containers/hyperkube:v1.7.3
docker save -o gcr.io_google_containers_hyperkube_v1.7.3.tar gcr.io/google_containers/hyperkube:v1.7.3
# then, on the machine where you are unable to docker pull::
curl -vo hyperkube.tar http://example.com/gcr.io_google_containers_hyperkube_v1.7.3.tar
docker load -i hyperkube.tar

You may be able to curl | docker load but I have experienced a lot more success using the on-disk tar than the piped method. I also periodically experience that docker load does as I asked, but does not retain the "tag," meaning you will need a subsequent docker tag 55d97676fd42 gcr.io/google_containers/hyperkube:v1.7.3 to be back in business

When I spoke about "the tradeoffs," another solution that may work better for you is to run your own docker registry (it's super easy with their docker image), then download the image as above but then push it into your local registry (where hopefully you will experience less blocking)

Finally, you may find the offline bare metal section informative, even if it's not strictly speaking what you asked

-- mdaniel
Source: StackOverflow