Score:0

Kubeadm with containerd cannot use locally loaded images

ao flag

I'm trying to build kubernetes with containerd in bare-metal server (RHEL8).

There's no Internet connection so I manually downloaded needed images (e.g. k8s.gcr.io/kube-scheduler:v1.22.1) and loaded them using "ctr image import".

The images seem to be loaded successfully.

#ctr images ls -q
k8s.gcr.io/coredns/coredns:v1.8.4
k8s.gcr.io/etcd:3.5.0-0
k8s.gcr.io/kube-apiserver:v1.22.1
k8s.gcr.io/kube-controller-manager:v1.22.1
k8s.gcr.io/kube-proxy:v1.22.1
k8s.gcr.io/kube-scheduler:v1.22.1
k8s.gcr.io/pause:3.5

Then I executed "kubeadm init" but it failed with ImagePull errors.

#kubeadm init --kubernetes-version=1.22.1 --cri-socket=/run/containerd/containerd.sock
[init] Using Kubernetes version: v1.22.1
[preflight] Running pre-flight checks
        [WARNING FileExisting-tc]: tc not found in system path
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'
error execution phase preflight: [preflight] Some fatal errors occurred:

How can I let kubeadm to use local images? Or is it OK to ignore these preflight errors?

Edit: This procedure (manually loading images instead of executing kubeadm config images pull) worked well when with docker and CentOS7.

Score:1
de flag

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.

Daigo avatar
ao flag
Actually I wanted to do that but there’s no Internet connection. With docker and CentOS7, I successfully installed kubernetes using the same procedure.
Score:1
ao flag

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 executing
kubeadm config images pull. The images that Kubernetes can use are shown in
ctr -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
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.