Kubernetes initialization failed

Hi, I am trying to build by kubernetes lab in airgap environment. Downloaded all the Kubernetes image on online node and after that load all kubernetes images on offline node.

Facing issue when trying to initialize kubernetes, getting failed to pull image error message which says temporary failure in name resolution.

    [ERROR ImagePull]: failed to pull image registry.k8s.io/kube-apiserver:v1.27.0: output: E0602 06:52:50.217378  263866 remote_image.go:171] "PullImage from image service failed" err="rpc error: code = Unknown desc = failed to pull and unpack image \"registry.k8s.io/kube-apiserver:v1.27.0\": failed to resolve reference \"registry.k8s.io/kube-apiserver:v1.27.0\": failed to do request: Head \"https://registry.k8s.io/v2/kube-apiserver/manifests/v1.27.0\": dial tcp: lookup registry.k8s.io: Temporary failure in name resolution" image="registry.k8s.io/kube-apiserver:v1.27.0"

time=“2023-06-02T06:52:50Z” level=fatal msg=“pulling image: rpc error: code = Unknown desc = failed to pull and unpack image "registry.k8s.io/kube-apiserver:v1.27.0": failed to resolve reference "registry.k8s.io/kube-apiserver:v1.27.0": failed to do request: Head "https://registry.k8s.io/v2/kube-apiserver/manifests/v1.27.0\”: dial tcp: lookup registry.k8s.io: Temporary failure in name resolution"
, error: exit status 1

Cluster information:

Kubernetes version: 1.27
Cloud being used: bare-metal
Installation method: Manual on airgap environment
Host OS: Ubuntu 20.04
CNI and version: flannel version 0.21.5
CRI and version: docker v20.10

Any help is really appreciated.

Thanks in advance…

Are you pulling images from a registry or are you loading them locally? Is the kube-api image available? Is that the only image that you can’t pull?

We need to see the health of your kubelet. Please run:

systemctl status kubelet

systemctl stop kubelet
date #make note of the time, you’ll need it to for the next command/kubelet logs
journalctl -xeu kubelet --since <date_from_above> --until now >> ~/kubelet-journal.log
Once we see this info we should have a more clear picture of what is happening.

Dear Jeremyatourville,

Thanks for your reply.

I have all the images available locally, please check below images.

In below output I have removed registry.k8s.io from in front on repository name as I am not allowed to share links.

root@kmaster:~# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
registry latest 65f3b3441f04 3 weeks ago 24MB
flannel/flannel v0.21.5 a6c0cb5dbd21 4 weeks ago 68.9MB
registry.k8s.io/kube-apiserver v1.27.0 6f707f569b57 7 weeks ago 121MB
registry.k8s.io/kube-scheduler v1.27.0 f73f1b39c3fe 7 weeks ago 58.4MB
registry.k8s.io/kube-controller-manager v1.27.0 95fe52ed4457 7 weeks ago 112MB
registry.k8s.io/kube-proxy v1.27.0 5f82fc39fa81 7 weeks ago 71.1MB
etcd 3.5.7-0 86b6af7dd652 4 months ago 296MB
pause 3.9 e6f181688397 7 months ago 744kB
ingress-nginx/controller v1.3.0 4d43c7489bf2 10 months ago 263MB
coredns 1.6.7 67da37a9a360 3 years ago 43.8MB

I am getting same message for all the images, its not about kube-api only.

kmaster:~# journalctl -xeu kubelet --since “2023-06-06 09:15:00” --until now >> kubelet-journal.log
kmaster:~# cat kubelet-journal.log
– Logs begin at Wed 2023-05-31 05:06:06 UTC, end at Tue 2023-06-06 09:18:42 UTC. –
– No entries –
root@kmaster:~#

I am new to kubernetes, please ignore for any silly question.

Thanks…
Digvijay Singh

OK, I didn’t know that none of your images are getting loaded. I have never used your method to load images. I might be of limited help but I’ll do my best. My images are loaded in a registry and I pull the images from there.

What happens when your run kubeadm init? Show us the output from that, it will give a better idea of what is happening when trying to load images.

Also, please show the output from systemctl status kubelet