![containerd 1.4.9 未実装 desc = 不明なサービスruntime.v1alpha2.RuntimeService](https://rvso.com/image/769308/containerd%201.4.9%20%E6%9C%AA%E5%AE%9F%E8%A3%85%20desc%20%3D%20%E4%B8%8D%E6%98%8E%E3%81%AA%E3%82%B5%E3%83%BC%E3%83%93%E3%82%B9runtime.v1alpha2.RuntimeService.png)
containerd 1.4.9
CentOS Steam 8 サーバーにインストールしました。
この文書に基づいてコンテナの開始. デフォルトの設定ファイルを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
1.21.3
このエラーを修正するにはどうすればいいでしょうか? これを修正した後、cfgroupを使用してこのノードを Kubernetes クラスターに参加させますsystemd
。
ありがとうSR
答え1
今日、ワーカー ノードで kubelet をアップグレードしているときに同じエラーが発生しました。問題はデフォルト構成内にありました。containerd は構成なしでも正常に実行されることに注意してください。私の場合は、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 ドキュメント
「これは、間違った containerd 構成を使用していることが原因である可能性があります (おそらく Docker インストールから)。実行している containerd インスタンスに合わせて containerd 構成を更新する必要があります。」
- 私自身、docker をインストールし、コマンド構文の違いを調べるために yum で crictl をインストールしたところ、この問題に遭遇しました。
- リンクされたドキュメントに掲載されている解決コマンドは、root として実行した場合にのみ機能するため、より一般的なバージョンを次に示します。
# 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 スナップショットを再設定したら問題はなくなりました。
設定 (/etc/containerd/config.toml) を削除しても機能しますが、containerd はデフォルト設定で実行されるため、これは望んでいたものではありません。
答え4
ちなみに、私の側では、設定する containerd の正しいパラメータは次の通りではありませんでした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