<p>I am trying to set up a Kubernetes master node. Every time I try to start kubelet I am getting the error message:</p>
<pre><code>command failed&quot; err=&quot;failed to validate kubelet flags: the container runtime endpoint address was not specified or empty, use --container-runtime-endpoint to set
</code></pre>
<p>I tries to set up the container runtime endpoint with the following command:</p>
<pre><code>sudo kubelet --container-runtime-endpoint=unix:///run/containerd/containerd.sock
</code></pre>
<p>But when I do, I get the following log with a failing command:</p>
<pre><code>I0116 09:43:02.562785    4142 server.go:412] &quot;Kubelet version&quot; kubeletVersion=&quot;v1.26.0&quot;
I0116 09:43:02.563067    4142 server.go:414] &quot;Golang settings&quot; GOGC=&quot;&quot; GOMAXPROCS=&quot;&quot; GOTRACEBACK=&quot;&quot;
I0116 09:43:02.563458    4142 server.go:575] &quot;Standalone mode, no API client&quot;
I0116 09:43:02.566523    4142 server.go:463] &quot;No api server defined - no events will be sent to API server&quot;
I0116 09:43:02.566664    4142 server.go:659] &quot;--cgroups-per-qos enabled, but --cgroup-root was not specified.  defaulting to /&quot;
I0116 09:43:02.567002    4142 container_manager_linux.go:267] &quot;Container manager verified user specified cgroup-root exists&quot; cgroupRoot=[]
I0116 09:43:02.567130    4142 container_manager_linux.go:272] &quot;Creating Container Manager object based on Node Config&quot; 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[]}
I0116 09:43:02.567232    4142 topology_manager.go:134] &quot;Creating topology manager with policy per scope&quot; topologyPolicyName=&quot;none&quot; topologyScopeName=&quot;container&quot;
I0116 09:43:02.567305    4142 container_manager_linux.go:308] &quot;Creating device plugin manager&quot;
I0116 09:43:02.567449    4142 state_mem.go:36] &quot;Initialized new in-memory state store&quot;
E0116 09:43:02.570133    4142 run.go:74] &quot;command failed&quot; err=&quot;failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint \&quot;unix:///run/containerd/containerd.sock\&quot;: rpc error: code = Unimplemented desc = unknown service runtime.v1.RuntimeService&quot;
</code></pre>
<p>Can anyone help me with this?</p>
<p>I have already tried resetting kubeadm because I read in a forum that could cause this problem.</p>
<p>This did not solve my problem. Outside of that, I read that going back to an older version of Kubernetes will work.
(But I did not try that. I want to use version 1.26 which is the newest).</p>
<p>And I cannot imagine Kubernetes making a version where containerd doesn't work. So where is the fix?</p>

<p>Looks like you are encountering the problem with <a href="https://kubernetes.io/blog/2022/11/18/upcoming-changes-in-kubernetes-1-26/#cri-api-removal" rel="noreferrer">Removal of the CRI v1alpha2 API and containerd 1.5 support</a> in K8s 1.26.</p>
<p><strong>Possible workarounds:</strong></p>
<p>You can solve this by removing the containerd package that came with Ubuntu and installing the containerd.io package from docker repositories. Then you get a 1.6 release. Then re-generate the container's config including the group changes and restart on 1.25-05. Then you are able to complete the upgrade to 1.26.</p>
<p>From there it was a simple do-release-upgrade to the latest ubuntu.</p>
<p><strong>1)</strong> In the Docker repos, there are packages for containerd 1.6 and above. So you can also add the Docker repos, and install containerd.io from there:</p>
<pre><code>sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo   &quot;deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable&quot; | sudo tee /etc/apt/sources.list.d/docker.list &gt; /dev/null
sudo apt update
sudo apt install containerd.io
</code></pre>
<p><strong>2)</strong> Manually upgrading containerd to 1.6 or above, by downloading and replacing the binaries</p>
<pre><code>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
</code></pre>
<p><strong>3)</strong> The one listed in the link above - running an older version of the kubelet (1.25)</p>
<pre><code>apt remove --purge kubelet
apt install -y kubeadm kubelet=1.25.5-00
</code></pre>
<p>Please go through the similar <a href="https://serverfault.com/questions/1118051/failed-to-run-kubelet-validate-service-connection-cri-v1-runtime-api-is-not-im">ServerFault Answers</a> for detailed step by srep information.</p>
<p><strong>EDIT :</strong></p>
<p><strong>4)</strong> Third-party replacement, <a href="https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/migrate-dockershim-dockerd/#what-is-cri-dockerd" rel="noreferrer">cri-dockerd</a>, is available. The cri-dockerd adapter lets you use Docker Engine through the <strong>Container Runtime Interface</strong>.</p>
<p>If you already use cri-dockerd, you aren't affected by the dockershim removal. Before you begin, <a href="https://kubernetes.io/docs/tasks/administer-cluster/migrating-from-dockershim/find-out-runtime-you-use/" rel="noreferrer">Check whether your nodes use the dockershim</a>.</p>
