Kubeadm with containerd cannot use locally loaded images
To manually pull the images execute the following:
kubeadm config images list
kubeadm config images pull
There is also a section for running kubeadm without an internet connection in the Kubernetes docs.
It turned out that I had to load images to the k8s.io
namespace of the containerd so that Kubernetes can recognize them. I was importing the images to the wrong namespace (default).
ctr -n k8s.io images import xxx.tar
...
After loading all the images that Kubernetes needs, kubeadm init worked well without executingkubeadm config images pull
. The images that Kubernetes can use are shown inctr -n k8s.io images ls
or crictl images
.
# crictl images
IMAGE TAG IMAGE ID SIZE
k8s.gcr.io/coredns/coredns v1.8.4 8d147537fb7d1 47.7MB
k8s.gcr.io/etcd 3.5.0-0 0048118155842 296MB
k8s.gcr.io/kube-apiserver v1.22.1 f30469a2491a5 130MB
k8s.gcr.io/kube-controller-manager v1.22.1 6e002eb89a881 123MB
k8s.gcr.io/kube-proxy v1.22.1 36c4ebbc9d979 105MB
k8s.gcr.io/kube-scheduler v1.22.1 aca5ededae9c8 53.9MB
k8s.gcr.io/pause 3.5 ed210e3e4a5ba 686kB