You can support us by downloading this article as PDF from the Link below. Download the guide as PDF

When setting up Kubernetes cluster with kubeadmin, an init command option is used to set up the Kubernetes control plane. Kubernetes has a number of Container images that will be used while bootstrapping a cluster.

In an environment where internet access is not reliable or when you have a restricted internet access like when using Proxy servers, or if your Kubernetes nodes doesn’t have internet access at all, it makes sense to pre-pull the container images to be used.

First you’ll need to print a list of images kubeadm will use ( on a machine with kubeadm installed).

$ sudo kubeadm config images list

The default registry used is, you have an option to use a different registry. E.g using docker:

$ sudo kubeadm config images list --image-repository

This will use the latest stable version of Kubernetes. You can also specify the version of Kubernetes to use, e.g stable, latest

$ sudo kubeadm config images list --kubernetes-version latest

Pull container images with kubeadm command

If your Kubernetes machines have access to internet for pulling Container images, you can use the kubeadm command to pre-pull the required images:

------- Pull from default registry: -------
$ sudo kubeadm config images pull

------- Pull from a different registry, e.g or internal -------
$ sudo kubeadm config images pull --image-repository

For docker you may need to login to pull the images:

$ sudo docker login
Login with your Docker ID to push and pull images from Docker Hub. If you don't have a Docker ID, head over to to create one.
Username: jmutai
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See

Login Succeeded

Note that if you change a container repository, you’ll need to do the same when running init.

$ sudo kubeadm init --image-repository <registry> <options>

Pull container images with docker / podman command

For Kubernetes nodes without internet access, you’ll need to download images from you Local machine and upload the to your Kubernetes nodes.

  • List images to be used on machine with kubeadm
sudo kubeadm config images list 
  • Download images locally
for image in \ \ \ \ \ \; do
sudo docker pull $image;

If using podman:

for image in \ \ \ \ \ \; do
sudo docker pull $image;
  • Save images as .tar files
# Example
mkdir ~/k8s-images
docker save > ~/k8s-images/kube-apiserver.tar
# Do the same for all other images
  • Upload saved images to Kubernetes nodes
rsync -av ~/k8s-images/* k8s-node:~/k8s-images/
  • Import .tar image files into Docker.
cd k8s-images/
ls * | while read image; do sudo docker load < $image; done

Here is a sample load output.

# ls * | while read image; do docker load < $image; done
225df95e717c: Loading layer [==================================================>]  336.4kB/336.4kB
7c9b0f448297: Loading layer [==================================================>]  41.37MB/41.37MB
Loaded image:
fe9a8b4f1dcc: Loading layer [==================================================>]  43.87MB/43.87MB
ce04b89b7def: Loading layer [==================================================>]  224.9MB/224.9MB
1b2bc745b46f: Loading layer [==================================================>]  21.22MB/21.22MB
Loaded image:
fc4976bd934b: Loading layer [==================================================>]  53.88MB/53.88MB
f103db1d7ea4: Loading layer [==================================================>]  118.6MB/118.6MB
Loaded image:
01b437934b9d: Loading layer [==================================================>]  108.5MB/108.5MB
Loaded image:
ac06623e44c6: Loading layer [==================================================>]   42.1MB/42.1MB
Loaded image:
682fbb19de80: Loading layer [==================================================>]  21.06MB/21.06MB
2dc2f2423ad1: Loading layer [==================================================>]  5.168MB/5.168MB
ad9fb2411669: Loading layer [==================================================>]  4.608kB/4.608kB
597151d24476: Loading layer [==================================================>]  8.192kB/8.192kB
0d8d54147a3a: Loading layer [==================================================>]  8.704kB/8.704kB
6bc5ae70fa9e: Loading layer [==================================================>]  37.81MB/37.81MB
Loaded image:
e17133b79956: Loading layer [==================================================>]  744.4kB/744.4kB
Loaded image:

Confirm the images are imported:

# docker images
REPOSITORY                           TAG                 IMAGE ID            CREATED             SIZE                v1.17.0             7d54289267dc        4 weeks ago         116MB            v1.17.0             0cae8d5cc64c        4 weeks ago         171MB   v1.17.0             5eb3b7486872        4 weeks ago         161MB            v1.17.0             78c190f736b1        4 weeks ago         94.4MB                   1.6.5               70f311871ae1        2 months ago        41.6MB                      3.4.3-0             303ce5db0e90        2 months ago        288MB                     3.1                 da86e6ba6ca1        2 years ago         742kB

You can then proceed with your Kubernetes installation with locally added images. Depending on the CNI you use, you may need to pull its image as well in advance if doing offline installations.

Courses to refer:

Also check:

How To Setup Local OpenShift 4.2 Cluster with CodeReady Containers

How To Export and Import Docker Images / Containers

How To run Docker Containers using Podman and Libpod

Best Books To learn Docker and Ansible Automation

You can support us by downloading this article as PDF from the Link below. Download the guide as PDF


Please enter your comment!
Please enter your name here