내(실험실/연구) Kubernetes 클러스터는 Containerd를 런타임(CRI)으로 사용하여 실행됩니다. /etc/containerd/config.toml을 보면 컨테이너가 원격 저장소에서 일시 중지된 이미지를 가져오는 것을 볼 수 있습니다.
sandbox_image = "registry.k8s.io/pause:3.8"
나는 Containerd에게 사용하라고 말하고 싶습니다정지시키다로컬 컨테이너 런타임으로 가져온 이미지:
lab@master:~$ sudo crictl image
IMAGE TAG IMAGE ID SIZE
docker.io/calico/cni v3.26.0 5d6f5c26c6554 93.3MB
docker.io/calico/kube-controllers v3.26.0 45ae357729e3a 33.8MB
docker.io/calico/node v3.26.0 44f52c09decec 87.6MB
registry.k8s.io/coredns/coredns v1.10.1 ead0a4a53df89 16.2MB
registry.k8s.io/etcd 3.5.10-0 a0eed15eed449 56.6MB
registry.k8s.io/kube-apiserver v1.28.7 eeb80ea665767 34.7MB
registry.k8s.io/kube-controller-manager v1.28.7 4d9d9de55f196 33.4MB
registry.k8s.io/kube-proxy v1.28.7 123aa721f941b 28.1MB
registry.k8s.io/kube-scheduler v1.28.7 309c26d006295 18.6MB
registry.k8s.io/pause 3.8 4873874c08efc 311kB <-- here
registry.k8s.io/pause 3.9 e6f1816883972 322kB
/etc/containerd/config.toml의 sandbox_image를 다음과 같이 수정해 보았습니다.
sandbox_image = "pause:3.8"
그러나 컨테이너 서비스가 시작되지 못했습니다.
Apr 05 21:49:20 master containerd[1803]: time="2024-04-05T21:49:20.386597952Z" level=info msg="StopPodSandbox for \"d100902f983a92cbf0f385d490fdec5917549c181c88f0287782f45d31f04226\""
Apr 05 21:49:20 master containerd[1803]: time="2024-04-05T21:49:20.389443313Z" level=info msg="Container to stop \"b6b0cbd161076fd52885b03ca55094535af3b2b86fa0d0412c47a4235ce46178\" must be in running or unknown state, current state \"CONTAINER_EXITED\""
Apr 05 21:49:20 master containerd[1803]: time="2024-04-05T21:49:20.392477900Z" level=info msg="TearDown network for sandbox \"d100902f983a92cbf0f385d490fdec5917549c181c88f0287782f45d31f04226\" successfully"
Apr 05 21:49:20 master containerd[1803]: time="2024-04-05T21:49:20.394401174Z" level=info msg="StopPodSandbox for \"d100902f983a92cbf0f385d490fdec5917549c181c88f0287782f45d31f04226\" returns successfully"
Apr 05 21:49:20 master containerd[1803]: time="2024-04-05T21:49:20.406690451Z" level=info msg="RunPodSandbox for &PodSandboxMetadata{Name:kube-scheduler-master,Uid:4043e87c9e9d5772c32e4050b11757a4,Namespace:kube-system,Attempt:22,}"
Apr 05 21:49:21 master containerd[1803]: time="2024-04-05T21:49:21.320155662Z" level=info msg="trying next host" error="pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed" host=registry-1.docker.io
Apr 05 21:49:21 master containerd[1803]: time="2024-04-05T21:49:21.330971667Z" level=error msg="RunPodSandbox for &PodSandboxMetadata{Name:kube-scheduler-master,Uid:4043e87c9e9d5772c32e4050b11757a4,Namespace:kube-system,Attempt:22,} failed, error" error="failed to get sandbox image \"pause:3.8\": failed to pull image \"pause:3.8\": failed to pull and unpack image \"docker.io/library/pause:3.8\": failed to resolve reference \"docker.io/library/pause:3.8\": pull access denied, repository does not exist or may require authorization: server message: insufficient_scope: authorization failed"
Apr 05 21:49:21 master containerd[1803]: time="2024-04-05T21:49:21.332934072Z" level=info msg="stop pulling image docker.io/library/pause:3.8: active requests=0, bytes read=5069"
질문: 사용하도록 컨테이너를 구성하는 방법정지시키다로컬 컨테이너 런타임의 이미지
고쳐 쓰다:
Pause:3.8을 ID 4873874c08efc로 바꾸었고 제대로 작동했습니다. ID는 유효하지만 이름이 유효하지 않은 이유가 있습니까?