Closed
Description
Problem
Following Kubernetes official installation instruction for containerd and kubeadm init
will fail with unknown service runtime.v1alpha2.RuntimeService
.
# Commands from https://kubernetes.io/docs/setup/production-environment/container-runtimes/#containerd
apt-get update && apt-get install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-get update && apt-get install -y containerd.io
# Configure containerd
mkdir -p /etc/containerd
containerd config default > /etc/containerd/config.toml
systemctl restart containerd
kubeadm init
...
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time="2020-09-24T11:49:16Z" level=fatal msg="getting status of runtime failed: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
, error: exit status 1
Solution:
rm /etc/containerd/config.toml
systemctl restart containerd
kubeadm init
Versions:
- Ubuntu 20.04 (focal)
- containerd.io 1.3.7
- kubectl 1.19.2
- kubeadm 1.19.2
- kubelet 1.19.2
Activity
fuweid commentedon Sep 25, 2020
@blinkiz could you please provide your containerd config.toml and command result of
ctr plugin ls
? thanksniklastojts commentedon Sep 25, 2020
Apparently it is my fault this time. My ansible playbook did not override config.toml file as I expected. Am sorry for taking up your time, default installation instructions work great.
In the
config.toml
file installed by packagecontainerd.io
there is the linedisabled_plugins = ["cri"]
that am guessing creating the issue. That maybe is bad default setting to have in the packagecontainerd.io
but that is for another issue/bug.Closing.
mikebrow commentedon Sep 25, 2020
Docker (by default) uses that config for the containerd they install via containerd.io packages. Grr. been causing similar ^ issues for k8s users for years. :-)
alexcpn commentedon Nov 25, 2020
I followed the official instructions here https://kubernetes.io/docs/setup/production-environment/container-runtimes/
and I was getting similar error
I checked /etc/containerd/config.toml and saw 'disabled_plugins = []'
Note the only thing I changed in the config.toml was to use systemd as true -it was different from the way docs has mentioned
(maybe this was the problem?)
from docs
deleting this config.toml as given in the first post and restarting containerd service solved and kubeadm could proceed
alexcpn commentedon Nov 25, 2020
This is definitely a bug. For the worker node I followed the docs exact and I was getting this error
till I deleted the config,toml restarted contained and kubelet, after which only the worker joined
fuweid commentedon Nov 26, 2020
@alexcpn please open new issue to describe the case, thanks.
41 remaining items
Jparmo commentedon Feb 24, 2023
I have the same problem when I try to join to master node and my containerd is activate, nothing works
version of kubelet=1.25.5-00
[preflight] Running pre-flight checks
[WARNING SystemVerification]: missing optional cgroups: blkio
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time="2023-02-24T20:01:08Z" 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
hamedsol commentedon Feb 25, 2023
Follow official documents regarding containerd to enable SystemCgroups on etc/containerd/config.toml if you don't have this file make it by sudo containerd config default | tee etc/containerd/configuration.toml , better to install containerd from binary rather than by package manager
Enoxime commentedon Feb 26, 2023
Got the same issue and fixed it by installing the containerd.io package from the docker repository instead of the one from ubuntu's repository.
see: https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository
I have ubuntu 22.04.2 on VMs and raspberry pies
Also it seems there is presently an issue to retrieve the gpg key from https://packages.cloud.google.com/apt/doc/apt-key.gpg
zsinba commentedon Mar 1, 2023
Got the same issue. there is no answer in debian 11.
riyazhakki commentedon Mar 14, 2023
I was having same issue on ubutnu 20.04.3, it got fixed after reinstalling docker,containrd, runc etc, then deleting the /etc/container.d/config.toml file.
thallgren commentedon Apr 7, 2023
I struggled with this too. The solution for me was to comment this line out in
/etc/containerd/config.toml
nivaran commentedon Apr 8, 2023
Refer to Three pages of Kubernetes Doc:
Steps :
OR can use single shell script for both master-node & worker node configuration
script Link - https://github.com/nivaran/Install_k8s_using_shell_script
fix(debian kube-mast): 🐛 fix unknown service runtime.v1alpha2.Runtime…
hub4ops commentedon May 12, 2023
Hi folks,
my bash history from the new control plane is below, it works.
arun-chib commentedon Jun 25, 2023
It got fixed for me finally:
fix:
Update contained to the latest and fix toml file with below changes:
disabled_plugins = ["cri"] -->> disabled_plugins = [""]
Done.
Thnak me later ;)
alanlupsha commentedon Feb 7, 2024
February 2024 fix:
bjrara commentedon Apr 23, 2024
This fix works for me! @alanlupsha Would you mind sharing how you came up with this fix?
alanlupsha commentedon Apr 23, 2024
I'm glad that works! I used them googles on the interwebs and put all the findings into this.