You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
By clicking “Sign up for GitHub”, you agree to our
terms of service
and
privacy statement
. We’ll occasionally send you account related emails.
Already on GitHub?
Sign in
to your account
Description
Hi, I have installed Docker version 20 and Kubernetes on ubuntu 22.4, when I try to do a
Kubeadm init
I get
salam@kubernetes:~$ sudo 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-20T08:33:48Z" 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
sudo systemctl status containerd
it is up and running as follows
not sure what I should do or check
Thanks for your help
Steps to reproduce the issue
Install Docker version 20.10.12, build 20.10.12-0ubuntu4
Install Kubernetes components through its rep Kubeam, kubelet,....
run kubeadm init
Describe the results you received and expected
[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-20T08:40:14Z" 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
What version of containerd are you using?
containerd github.com/containerd/containerd 1.5.9-0ubuntu3.1
Any other relevant information
crictl info
salam@kubernetes:~$ crictl info
WARN[0000] runtime connect using default endpoints: [unix:///var/run/dockershim.sock unix:///run/containerd/containerd.sock unix:///run/crio/crio.sock unix:///var/run/cri-dockerd.sock]. As the default settings are now deprecated, you should set the endpoint instead.
E0220 08:42:53.348417 2971 remote_runtime.go:616] "Status from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory""
FATA[0000] getting status of runtime: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /var/run/dockershim.sock: connect: no such file or directory"
Show configuration if it is related to CRI plugin.
cat: /etc/containerd/config.toml: No such file or directory
Thanks Helen-frank, I issued the folloing command
sudo cat /etc/crictl.yaml
but it seems that there is no crictl.yaml
cat: /etc/crictl.yaml: No such file or directory
I did
sudo find / -name crictl.yaml
also it found nothing
I get
FATA[0000] validate service connection: CRI v1 runtime API is not implemented for endpoint "unix:///run/containerd/containerd.sock": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService
rerun
E0220 09:58:16.039139 4374 remote_runtime.go:390] "ListContainers with filter from runtime service failed" err="rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"" filter="&ContainerFilter{Id:,State:&ContainerStateValue{State:CONTAINER_RUNNING,},PodSandboxId:,LabelSelector:map[string]string{},}"
FATA[0000] listing containers: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial unix /run/containerd/containerd.sock: connect: permission denied"
salam@kubernetes:/$ sudo crictl ps
FATA[0000] validate service connection: CRI v1 runtime API is not implemented for endpoint "unix:///run/containerd/containerd.sock": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService
I got it, you introduced the containerd by installing docker, so the cri plug-in will not be enabled, so crictl cannot be used normally, and secondly, the containerd
/etc/containerd/config.toml
used by docker should be like this
#
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"
Then
systemctl restart containerd
You try to start a nginx using docker run to see if it can be used normally.
After googling and updating several config files especailly with cgroup driver systemd, now I discovered that kubelet service is not starting
and here is the config file
I'm also facing the same problem. I tried tons of solutions and none of them worked for me. I'm running a VM with Vagrant.
Ubuntu 20.04
kubeadm 1.26.1
kubelet 1.26.1
I recreated the config.toml running the command
containeird config default
and also checked if there's no
cri
declaration in the disabled_plugins and it's all ok. I noticed that kubelet is not running and I tried to start the kubelet manually and I got this output:
vagrant@vm1:~$ sudo kubelet --container-runtime-endpoint="unix:///run/containerd/containerd.sock"
I0220 19:07:40.444817 10648 server.go:412] "Kubelet version" kubeletVersion="v1.26.1"
I0220 19:07:40.444885 10648 server.go:414] "Golang settings" GOGC="" GOMAXPROCS="" GOTRACEBACK=""
I0220 19:07:40.445239 10648 server.go:575] "Standalone mode, no API client"
I0220 19:07:40.445413 10648 server.go:631] "Failed to get the kubelet's cgroup. Kubelet system container metrics may be missing." err="cpu and memory cgroup hierarchy not unified. cpu: /user.slice, memory: /user.slice/user-1000.slice/session-6.scope"
I0220 19:07:40.449819 10648 server.go:463] "No api server defined - no events will be sent to API server"
I0220 19:07:40.449865 10648 server.go:659] "--cgroups-per-qos enabled, but --cgroup-root was not specified. defaulting to /"
I0220 19:07:40.450381 10648 container_manager_linux.go:267] "Container manager verified user specified cgroup-root exists" cgroupRoot=[]
I0220 19:07:40.450453 10648 container_manager_linux.go:272] "Creating Container Manager object based on Node Config" nodeConfig={RuntimeCgroupsName: SystemCgroupsName: KubeletCgroupsName: KubeletOOMScoreAdj:-999 ContainerRuntime: CgroupsPerQOS:true CgroupRoot:/ CgroupDriver:cgroupfs KubeletRootDir:/var/lib/kubelet ProtectKernelDefaults:false NodeAllocatableConfig:{KubeReservedCgroupName: SystemReservedCgroupName: ReservedSystemCPUs: EnforceNodeAllocatable:map[pods:{}] KubeReserved:map[] SystemReserved:map[] HardEvictionThresholds:[]} QOSReserved:map[] CPUManagerPolicy:none CPUManagerPolicyOptions:map[] ExperimentalTopologyManagerScope:container CPUManagerReconcilePeriod:10s ExperimentalMemoryManagerPolicy:None ExperimentalMemoryManagerReservedMemory:[] ExperimentalPodPidsLimit:-1 EnforceCPULimits:true CPUCFSQuotaPeriod:100ms ExperimentalTopologyManagerPolicy:none ExperimentalTopologyManagerPolicyOptions:map[]}
I0220 19:07:40.450485 10648 topology_manager.go:134] "Creating topology manager with policy per scope" topologyPolicyName="none" topologyScopeName="container"
I0220 19:07:40.450531 10648 container_manager_linux.go:308] "Creating device plugin manager"
I0220 19:07:40.450717 10648 state_mem.go:36] "Initialized new in-memory state store"
E0220 19:07:40.452363 10648 run.go:74] "command failed" err="failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint \"unix:///run/containerd/containerd.sock\": rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService"
jcavellec, bartigorfs, azzaka, sswamyn, MQPearth, jacksparrow47, samlsso1, abdulrhmannasser, liuqiqi-Y, sagarfale, and 2 more reacted with thumbs up emoji
eosantigen, SilentCC, ajayanaj, jcavellec, liuqiqi-Y, Andras-Csanyi, and chucoding reacted with hooray emoji
All reactions
I had a same error while executing command
kubeadm init --pod-network-cidr=10.244.0.0/16
.
Error :
root@ubuntu:/home/ahens# kubeadm init
W0331 08:19:51.766302 4689 version.go:104] could not fetch a Kubernetes version from the internet: unable to get URL "https://dl.k8s.io/release/stable-1.txt": Get "https://storage.googleapis.com/kubernetes-release/release/stable-1.txt": dial tcp: lookup storage.googleapis.com on 127.0.0.53:53: server misbehaving
W0331 08:19:51.766302 4689 version.go:105] falling back to the local client version: v1.26.3
[init] Using Kubernetes version: v1.26.3
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time="2023-03-31T08:19:52Z" 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
root@ubuntu:/home/ahens#
I performed below steps :
Correct configuration is specified for the endpoint "unix:///var/run/containerd/containerd.sock" and enabled the plugin instead of disabled.
Added below code in /etc/containerd/config.toml
[plugins."io.containerd.grpc.v1.cri".containerd]
endpoint = "unix:///var/run/containerd/containerd.sock"
systemctl restart containerd
My /etc/containerd/config.toml file :
root@ubuntu:/etc# cat /etc/containerd/config.toml
# 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.
enabled_plugins = ["cri"]
[plugins."io.containerd.grpc.v1.cri".containerd]
endpoint = "unix:///var/run/containerd/containerd.sock"
#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"
root@ubuntu:/etc#
This resolved my issue.
sheercoding, hewenyu, ajuric, srn221B, supakornbabe, iKryss05, DuyTC1811, RogerTaylor130, zpeng101, Max-Qiu, and 6 more reacted with thumbs up emoji
pakindessama, Louhwz, Pingm0, dvxone, bsumanji, sheercoding, ajuric, srn221B, iKryss05, DuyTC1811, and 4 more reacted with heart emoji
All reactions
I have the same error despite the solution above.
enabled_plugins = ["cri"]
[plugins."io.containerd.grpc.v1.cri".containerd]
endpoint = "unix:///var/run/containerd/containerd.sock"`
The error is still presistant
[root@master ~]# kubeadm init --pod-network-cidr=10.10.0.1/24
[init] Using Kubernetes version: v1.27.0
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time="2023-04-12T15:40:40-04: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
keep getting the same issue for me
root@kubeadm-master:~# kubeadm init --pod-network-cidr=10.244.0.0/16
I0502 08:12:08.289522 4204 version.go:255] remote version is much newer: v1.27.1; falling back to: stable-1.24
[init] Using Kubernetes version: v1.24.13
[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: E0502 08:12:08.411082 4213 remote_runtime.go:925] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
time="2023-05-02T08:12:08Z" level=fatal msg="getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.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
When i did a verbose with --v=5
root@kubeadm-master:~# kubeadm init --pod-network-cidr=10.244.0.0/16 --v=5
I0502 08:12:38.925399 4247 initconfiguration.go:117] detected and using CRI socket: unix:///var/run/containerd/containerd.sock
I0502 08:12:38.925881 4247 interface.go:432] Looking for default routes with IPv4 addresses
I0502 08:12:38.925900 4247 interface.go:437] Default route transits interface "eth0"
I0502 08:12:38.926105 4247 interface.go:209] Interface eth0 is up
I0502 08:12:38.926215 4247 interface.go:257] Interface "eth0" has 3 addresses :[159.223.189.10/20 10.10.0.5/16 fe80::f8e0:2fff:fee3:b207/64].
I0502 08:12:38.926278 4247 interface.go:224] Checking addr 159.223.189.10/20.
I0502 08:12:38.926331 4247 interface.go:231] IP found 159.223.189.10
I0502 08:12:38.926374 4247 interface.go:263] Found valid IPv4 address 159.223.189.10 for interface "eth0".
I0502 08:12:38.926420 4247 interface.go:443] Found active IP 159.223.189.10
I0502 08:12:38.926491 4247 kubelet.go:214] the value of KubeletConfiguration.cgroupDriver is empty; setting it to "systemd"
I0502 08:12:38.931392 4247 version.go:186] fetching Kubernetes version from URL: https://dl.k8s.io/release/stable-1.txt
I0502 08:12:39.037971 4247 version.go:255] remote version is much newer: v1.27.1; falling back to: stable-1.24
I0502 08:12:39.038025 4247 version.go:186] fetching Kubernetes version from URL: https://dl.k8s.io/release/stable-1.24.txt
[init] Using Kubernetes version: v1.24.13
[preflight] Running pre-flight checks
I0502 08:12:39.120766 4247 checks.go:570] validating Kubernetes and kubeadm version
I0502 08:12:39.120795 4247 checks.go:170] validating if the firewall is enabled and active
I0502 08:12:39.135043 4247 checks.go:205] validating availability of port 6443
I0502 08:12:39.135299 4247 checks.go:205] validating availability of port 10259
I0502 08:12:39.135337 4247 checks.go:205] validating availability of port 10257
I0502 08:12:39.135380 4247 checks.go:282] validating the existence of file /etc/kubernetes/manifests/kube-apiserver.yaml
I0502 08:12:39.135400 4247 checks.go:282] validating the existence of file /etc/kubernetes/manifests/kube-controller-manager.yaml
I0502 08:12:39.135421 4247 checks.go:282] validating the existence of file /etc/kubernetes/manifests/kube-scheduler.yaml
I0502 08:12:39.135436 4247 checks.go:282] validating the existence of file /etc/kubernetes/manifests/etcd.yaml
I0502 08:12:39.135539 4247 checks.go:432] validating if the connectivity type is via proxy or direct
I0502 08:12:39.135645 4247 checks.go:471] validating http connectivity to first IP address in the CIDR
I0502 08:12:39.135675 4247 checks.go:471] validating http connectivity to first IP address in the CIDR
I0502 08:12:39.135701 4247 checks.go:106] validating the container runtime
I0502 08:12:39.156384 4247 checks.go:331] validating the contents of file /proc/sys/net/bridge/bridge-nf-call-iptables
I0502 08:12:39.156502 4247 checks.go:331] validating the contents of file /proc/sys/net/ipv4/ip_forward
I0502 08:12:39.156542 4247 checks.go:646] validating whether swap is enabled or not
I0502 08:12:39.156589 4247 checks.go:372] validating the presence of executable crictl
I0502 08:12:39.156631 4247 checks.go:372] validating the presence of executable conntrack
I0502 08:12:39.156648 4247 checks.go:372] validating the presence of executable ip
I0502 08:12:39.156679 4247 checks.go:372] validating the presence of executable iptables
I0502 08:12:39.156730 4247 checks.go:372] validating the presence of executable mount
I0502 08:12:39.156810 4247 checks.go:372] validating the presence of executable nsenter
I0502 08:12:39.156832 4247 checks.go:372] validating the presence of executable ebtables
I0502 08:12:39.156860 4247 checks.go:372] validating the presence of executable ethtool
I0502 08:12:39.156882 4247 checks.go:372] validating the presence of executable socat
I0502 08:12:39.156903 4247 checks.go:372] validating the presence of executable tc
I0502 08:12:39.156923 4247 checks.go:372] validating the presence of executable touch
I0502 08:12:39.156944 4247 checks.go:518] running all checks
[WARNING SystemVerification]: missing optional cgroups: blkio
I0502 08:12:39.179276 4247 checks.go:403] checking whether the given node name is valid and reachable using net.LookupHost
I0502 08:12:39.179382 4247 checks.go:612] validating kubelet version
I0502 08:12:39.262715 4247 checks.go:132] validating if the "kubelet" service is enabled and active
I0502 08:12:39.275355 4247 checks.go:205] validating availability of port 10250
I0502 08:12:39.275472 4247 checks.go:205] validating availability of port 2379
I0502 08:12:39.275515 4247 checks.go:205] validating availability of port 2380
I0502 08:12:39.275549 4247 checks.go:245] validating the existence and emptiness of directory /var/lib/etcd
[preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: E0502 08:12:39.153287 4256 remote_runtime.go:925] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
time="2023-05-02T08:12:39Z" level=fatal msg="getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
, error: exit status 1
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
error execution phase preflight
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run.func1
cmd/kubeadm/app/cmd/phases/workflow/runner.go:235
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).visitAll
cmd/kubeadm/app/cmd/phases/workflow/runner.go:421
k8s.io/kubernetes/cmd/kubeadm/app/cmd/phases/workflow.(*Runner).Run
cmd/kubeadm/app/cmd/phases/workflow/runner.go:207
k8s.io/kubernetes/cmd/kubeadm/app/cmd.newCmdInit.func1
cmd/kubeadm/app/cmd/init.go:153
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).execute
vendor/github.com/spf13/cobra/command.go:856
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).ExecuteC
vendor/github.com/spf13/cobra/command.go:974
k8s.io/kubernetes/vendor/github.com/spf13/cobra.(*Command).Execute
vendor/github.com/spf13/cobra/command.go:902
k8s.io/kubernetes/cmd/kubeadm/app.Run
cmd/kubeadm/app/kubeadm.go:50
main.main
cmd/kubeadm/kubeadm.go:25
runtime.main
/usr/local/go/src/runtime/proc.go:250
runtime.goexit
/usr/local/go/src/runtime/asm_amd64.s:1571
When i check the status of containerd:
root@kubeadm-master:~# systemctl status containerd
● containerd.service - containerd container runtime
Loaded: loaded (/lib/systemd/system/containerd.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2023-05-02 08:09:22 UTC; 4min 46s ago
Docs: https://containerd.io
Main PID: 2840 (containerd)
Tasks: 9
Memory: 11.9M
CPU: 1.453s
CGroup: /system.slice/containerd.service
└─2840 /usr/bin/containerd
mv /etc/containerd/config.toml /root/config.toml.bak
systemctl restart containerd
Doing this works but the etcd and api pods keep failing.
WARNING: 2023/05/02 08:21:49 [core] grpc: addrConn.createTransport failed to connect to {127.0.0.1:2379 127.0.0.1:2379 0 }. Err: connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:2379: connect: connection refused". Reconnecting...
WARNING: 2023/05/02 08:21:49 [core] grpc: addrConn.createTransport failed to connect to {159.223.189.10:2379 159.223.189.10:2379 0 }. Err: connection error: desc = "transport: Error while dialing dial tcp 159.223.189.10:2379: connect: connection refused". Reconnecting...
Configure containerd
mkdir -p /etc/containerd
containerd config default | tee /etc/containerd/config.toml
sudo sed -i 's/SystemdCgroup = true/SystemdCgroup = false/g' /etc/containerd/config.toml
Restart containerd
systemctl restart containerd
Seems buggered for me, as nothing on the page helped.
root@k8s-master1:kubeadm init --control-plane-endpoint=k8s-master1
[init] Using Kubernetes version: v1.27.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-05-15T09:12:08+12: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
root@k8s-master1:#
Im also facing the same issue but so perfect solution for it..Anyon found any solution for this issue?
Error:
[init] Using Kubernetes version: v1.27.2
[preflight] Running pre-flight checks
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: time="2023-05-29T10:11:38Z" 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
Fix the Error
To fix the error you can delete the config.tomal file and restart containerd then try the init command like below:
$ rm /etc/containerd/config.toml
$ systemctl restart containerd
$ kubeadm init
https://k21academy.com/docker-kubernetes/container-runtime-is-not-running/
Note:100% it worked for me
Here is my workaround:
sudo mv /etc/containerd/config.toml /tmp/
sudo systemctl restart containerd.service
sudo kubeadm init --v=9
negative test to reproduce
sudo kubeadm reset -f
sudo systemctl restart containerd.service
sudo kubeadm init --v=9 # failed as expected below
[preflight] Some fatal errors occurred:
[ERROR CRI]: container runtime is not running: output: E0607 17:11:38.065090 1225428 remote_runtime.go:948] "Status from runtime service failed" err="rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
time="2023-06-07T17:11:38+08:00" level=fatal msg="getting status of runtime: rpc error: code = Unimplemented desc = unknown service runtime.v1alpha2.RuntimeService"
, error: exit status 1
Note:100% it worked for me & can reproduced issue
So there are a number of issues in this issue..
When trying to connect to containerd via the cri api:
you can't be using the version of the config that docker installs with cri disabled. You can enable the cri config, switch to the default config by deleting it, copy over the default config etc...
certain versions of crictl/kubelet (kubernetes) require certain versions of the CRI api.. if you don't have a match for api versions you'll get the unimplemented error
if you are running a 1.5 version of containerd it does not have the v1 CRI api.. thus you won't be able to connect to a version of crictl/kubelet that requires the v1 CRI api, version 1.5 of CRI only has the v1alpha2 CRI api and version 1.26 and up of kubernetes only support v1 CRI;
version 1.6 and 1.7 of containerd have both v1alpha2 and v1 CRI apis so these versions of containerd should work with pretty much any version of kubernetes currently in support
check the version of containerd and the version of kubelet/crictl that you are using and make sure they match up
here's the table explaining this https://github.com/containerd/containerd/blob/main/RELEASES.md#kubernetes-support
When running off the current main branch of containerd (soon to be the v2 version) only the v1 CRI api is included so you'll need to be on a v1.24 or later version of crictl/kubelet(kubernetes)
you need to be running as root when connecting to a version of containerd that is running as root... otherwise you'll get the connection refused error
apologies for any confusion, please reopen or comment if these resolutions do not fix you problem..
Same. Are there any updates on this?
please go to /etc/containerd/config.toml change disabled_plugin to enabled_plugin
This works ..
Fix the Error To fix the error you can delete the config.tomal file and restart containerd then try the init command like below:
$ rm /etc/containerd/config.toml $ systemctl restart containerd $ kubeadm init
https://k21academy.com/docker-kubernetes/container-runtime-is-not-running/
Note:100% it worked for me
Top! worked for me too