Containerd 1.4.9 구현되지 않은 desc = 알 수 없는 서비스 Runtime.v1alpha2.RuntimeService

Containerd 1.4.9 구현되지 않은 desc = 알 수 없는 서비스 Runtime.v1alpha2.RuntimeService

containerd 1.4.9CentOS Steam 8 서버에 설치했습니다 .

이 문서를 기반으로https://containerd.io/docs/getting-started/. containerd config default > /etc/containerd/config.toml이와 같은 기본 구성 파일을 만들었습니다 .

Containerd를 다시 시작한 후 실행하면 crictl ps아래 오류가 발생합니다.

FATA[0000] listing containers failed: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService

이 오류를 해결하는 방법은 무엇입니까? 이 문제를 해결한 후 cfgroup을 1.21.3사용하여 이 노드를 Kubernetes 클러스터에 가입하고 싶습니다 systemd.

고마워요 SR

답변1

오늘 작업자 노드에서 kubelet을 업그레이드하는 동안 동일한 오류가 발생했습니다. 문제는 기본 구성 내에 있었습니다. 아무런 구성 없이도 컨테이너가 제대로 실행된다는 점에 유의하세요. 내 경우에는 systemd_cgroup을 활성화하고 싶었습니다.

ctr plugin ls기본 구성에서 cri 플러그인이 오류 상태에 있음을 보여주었습니다.

systemd_cgroup 문제가 해결된 빈 구성만 있으면 됩니다.

cat > /etc/containerd/config.toml <<EOF
[plugins."io.containerd.grpc.v1.cri"]
  systemd_cgroup = true
EOF
systemctl restart containerd

답변2

오류에 대한 배경 컨텍스트:
에서gitlab.cncf.ci/containerd crictl.md 문서

"잘못된 컨테이너 구성(Docker 설치로 인한 것일 수 있음)을 사용하고 있을 수 있습니다. 실행 중인 컨테이너 인스턴스로 컨테이너 구성을 업데이트해야 합니다."

  • 나 자신은 docker를 설치한 다음 yum에서 crictl을 설치하여 명령 구문 차이점을 조사하고 이 문제를 만났습니다.
  • 링크된 문서에 게시된 해결 명령은 루트로 실행하는 경우에만 작동하므로 여기에 보다 일반적인 버전이 있습니다.
# Backup old containerd config (optional)
sudo mv /etc/containerd/config.toml /etc/containerd/config.bak

# Regenerate containerd config
sudo containerd config default | sudo tee /etc/containerd/config.toml

# Restart containerd
sudo systemctl restart containerd

# The above got it to work for me; but with some warnings 
# and ignorable errors that looked this this: 
sudo crictl ps
# WARN[0000] runtime connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock]. As the default settings are now deprecated, you should set the endpoint instead.
# ERRO[0002] connect endpoint 'unix:///var/run/dockershim.sock', make sure you are running as root and the endpoint has been started: context deadline exceeded
# WARN[0002] image connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock]. As the default settings are now deprecated, you should set the endpoint instead.
# ERRO[0004] connect endpoint 'unix:///var/run/dockershim.sock', make sure you are running as root and the endpoint has been started: context deadline exceeded
# CONTAINER           IMAGE               CREATED             STATE               NAME                ATTEMPT             POD ID
# ^-- The last line represents correct output, which is why 
# I say ignorable warnings/errors, even the post command 
# exit code seeable using 'echo $?' exit code shows success

# What cleaned up the errors for me was copy pasting the following
echo """
runtime-endpoint: unix:///run/containerd/containerd.sock
image-endpoint: unix:///run/containerd/containerd.sock
""" | sudo tee /etc/crictl.yaml

docker ps
# ^-- no more errors :)

# Note others may need to run one of these instead, based on their
# system's config, keep trying docker ps until one config works
echo """
runtime-endpoint: unix:///var/run/crio/crio.sock
image-endpoint: unix:///var/run/crio/crio.sock
""" | sudo tee /etc/crictl.yaml

echo """
runtime-endpoint: unix:///var/run/dockershim.sock
image-endpoint: unix:///var/run/dockershim.sock
""" | sudo tee /etc/crictl.yaml

답변3

이 문제는 CRI 플러그인의 오류와 관련이 있습니다. CRI 플러그인의 상태를 확인할 수 있습니다.

ctr plugin ls

과거에는 devmapper 문제로 인해 동일한 문제가 발생했습니다. devmapper가 기본 CRI 스냅샷 도구로 구성되었기 때문에 CRI에도 오류가 발생했습니다.

TYPE                                  ID                       PLATFORMS      STATUS
io.containerd.snapshotter.v1          devmapper                linux/amd64    error
io.containerd.grpc.v1                 cri                      linux/amd64    error

devmapper snapshotter를 재구성한 후에 문제가 사라졌습니다.

구성(/etc/containerd/config.toml)을 제거해도 작동하지만 컨테이너는 내가 원했던 것과는 다른 기본 구성으로 실행됩니다.

답변4

FWIW, 결국 설정할 컨테이너의 올바른 매개 변수는 다음 systemd_cgroup과 같습니다.

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
            #[...]
            SystemdCgroup = true

어느~이다구성 파일의 다른 설정.

그리고이는 공식 Kubernetes 문서에서 true로 설정하도록 지시하는 실제 설정입니다.https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd-systemd

관련 정보