飽き性の頭の中

Raspberry Pi 4にUbuntu Server 22.04.2 LTS (64-bit)をインストールしてkubeadm initするときにでたエラー

Raspberry Pi 4にUbuntu Server 22.04.2 LTS (64-bit)をインストールしてkubeadm initするときにでたエラー

tawachan
tawachan

Ubuntu Server 22.04.2 LTS (64-bit)で Kubeadm init したときにでたエラーを ChatGPT に相談して解決したときのメモです。

Raspberry Pi 4 に Ubuntu Server 22.04.2 LTS (64-bit)をインストールして、そこに Docker, Kubernetes 周りの設定をした。

インストール自体はこの記事を参考にして実行した。

そして、kubeadm initするときにエラーが出た

   tawachan@tawaberry-4a:~$ sudo kubeadm init
[sudo] password for tawachan:
[init] Using Kubernetes version: v1.27.4
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
	[ERROR CRI]: container runtime is not running: output: time="2023-07-28T22:34:16+09:00" level=fatal msg="validate service connection: CRI v1 runtime API is not implemented for endpoint \"unix:///var/run/containerd/containerd.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService"
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with `--ignore-preflight-errors=...`
To see the stack trace of this error execute with --v=5 or higher

ChatGPT に聞いたところ、/etc/containerd/config.tomlが怪しいと指摘される。

   tawachan@tawaberry-4a:~$ cat /etc/containerd/config.toml
##   Copyright 2018-2022 Docker Inc.

##   Licensed under the Apache License, Version 2.0 (the "License");
##   you may not use this file except in compliance with the License.
##   You may obtain a copy of the License at

##       http://www.apache.org/licenses/LICENSE-2.0

##   Unless required by applicable law or agreed to in writing, software
##   distributed under the License is distributed on an "AS IS" BASIS,
##   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
##   See the License for the specific language governing permissions and
##   limitations under the License.

disabled_plugins = ["cri"]

#root = "/var/lib/containerd"
#state = "/run/containerd"
#subreaper = true
#oom_score = 0

#[grpc]
##  address = "/run/containerd/containerd.sock"
##  uid = 0
##  gid = 0

#[debug]
##  address = "/run/containerd/debug.sock"
##  uid = 0
##  gid = 0
##  level = "info"


この内容を教えたら次の回答を得た。

エラーの原因は、設定ファイル/etc/containerd/config.toml にて cri プラグインが無効化されていることで、これは Kubernetes が動作するために必要なコンポーネントです。したがって、それを有効化するために次の手順を試してみてください。

   disabled_plugins = ["cri"]

この箇所を削除したら無事に動いた。

ChatGPT のおかげで、個別環境に合わせて応答してくれるからとても助かった。

関連記事