sandervanvugt / kubernetes

202 stars 244 forks source link

After setup-container.sh and setup-kubetools.sh, kubeadm init fails on Ubuntu 22.04 #4

Open drq883 opened 1 year ago

drq883 commented 1 year ago

I deployed 3 hosts to create a k8s cluster. Using the O'Reilly Getting Started with Kubernetes, 3rd Edition.

Each host has Ubuntu 22.04.1 LTS installed.

The error shown is:

root@drqk8sctl:~/kubernetes# kubeadm init
[init] Using Kubernetes version: v1.26.1
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
        [ERROR CRI]: container runtime is not running: output: time="2023-02-03T12:33:14-05: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

This setup is pretty easy to redeploy to provide any logs, config files needed.

Thanks.

drq883 commented 1 year ago

Referencing this page: https://stackoverflow.com/questions/75131916/failed-to-validate-kubelet-flags-the-container-runtime-endpoint-address-was-not

The suggestion of running this fixed it (bad version of containerd in ubuntu 22.04.1):

wget https://github.com/containerd/containerd/releases/download/v1.6.12/containerd-1.6.12-linux-amd64.tar.gz
tar xvf containerd-1.6.12-linux-amd64.tar.gz
systemctl stop containerd
cd bin
cp * /usr/bin/
systemctl start containerd