2

System

Ubuntu 22.04.01

kubeadm v1.25.4

containerd 1.6.10

Description

I'm trying to setup k8s 1.25.4 with a private docker repository and the containerd runtime.

I followed the docs to overwrite the sandbox image in /etc/containerd/config.toml:

...
[plugins."io.containerd.grpc.v1.cri"]
  sandbox_image = "my-private-registry:5000/registry.k8s.io/pause:3.8"
...

Afterwards, the containerd service, and later the machine, was restarted.

However, when trying to initialize the k8s cluster with kubeadm (kubeadm init --config cluster-config.yml), the initalization failed with journalctl -exu containerd showing the following output:

Dec 14 11:04:00 myhost containerd[866]: time="2022-12-14T11:04:00.911273848Z" level=info msg="trying next host" error="failed to do request: Head \"https://registry.k8s.io/v2/pause/manifests/3.6\": dial tcp 34.107.244.51:443: i/o timeout" host=registry.k8s.io
Dec 14 11:04:00 myhost containerd[866]: time="2022-12-14T11:04:00.927516068Z" level=error msg="RunPodSandbox for &PodSandboxMetadata{Name:myhost,Uid:c4ebaf5ac4e21e7bc99cda96857ec39e,Namespace:kube-system,Attempt:0,} failed, error" error="failed to get sandbox image \"registry.k8s.io/pause:3.6\": failed to pull image \"registry.k8s.io/pause:3.6\": failed to pull and unpack image \"registry.k8s.io/pause:3.6\": failed to resolve reference \"registry.k8s.io/pause:3.6\": failed to do request: Head \"https://registry.k8s.io/v2/pause/manifests/3.6\": dial tcp 34.107.244.51:443: i/o timeout"

This indicates to me that the sandbox image overwrite was unsuccessful. cluster-config.yml is configured to use the private registry and kubeadm can succesfully pull the k8s images (including the sandbox image):

...
imageRepository: my-private-registry:5000
...

What am I missing here?

danteu
  • 21
  • 1
  • 2

1 Answers1

1

I am facing the same issue, for me, I add the version = 2 config in /etc/containerd/config.toml and it works:

version = 2
[plugins."io.containerd.grpc.v1.cri".registry]
   config_path = "/etc/containerd/certs.d"

[plugins."io.containerd.grpc.v1.cri"] #sandbox_image = "k8s.m.daocloud.io/pause:3.6" sandbox_image = "registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.6"

check the new sandbox image address:

[root@k8sslave01 ~]# crictl info|grep pause
    "sandboxImage": "registry.cn-hangzhou.aliyuncs.com/google_containers/pause:3.6",

this is the official config doc: https://github.com/containerd/cri/blob/master/docs/config.md

Dolphin
  • 171
  • 1
  • 8