When initializing kubelet v1.26.0 on Ubuntu 22.04, the critical error appears in the logs:
E1214 15:41:16.402173 18015 run.go:74] "command failed" err="failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint \"unix:///var/run/containerd/containerd.sock\""
Kubernetes 1.26 made a significant change by deprecating CRI v1alpha2 and requiring CRI v1 support from container runtimes. The error occurs because:
- Your containerd version might be too old (pre-1.6.x)
- The CRI plugin isn't properly configured in containerd
- Kubelet can't negotiate the CRI API version with containerd
1. Verify containerd installation:
containerd --version
# Should show 1.6.0 or higher
# If not, upgrade containerd first:
sudo apt-get update && sudo apt-get install -y containerd.io
2. Configure containerd for CRI v1:
Edit the containerd config file at /etc/containerd/config.toml
:
[plugins."io.containerd.grpc.v1.cri"]
disable_tcp_service = false
stream_server_address = "127.0.0.1"
stream_server_port = "0"
enable_selinux = false
sandbox_image = "registry.k8s.io/pause:3.6"
3. Restart containerd and kubelet:
sudo systemctl restart containerd
sudo systemctl restart kubelet
If the issue persists, explicitly configure the CRI socket in kubelet:
sudo vi /etc/default/kubelet
# Add this line:
KUBELET_EXTRA_ARGS="--container-runtime-endpoint=unix:///var/run/containerd/containerd.sock --runtime-request-timeout=15m"
After applying fixes, check:
sudo crictl info | grep "apiVersion"
# Should show:
# "apiVersion": "runtime.v1"
Also verify kubelet status:
systemctl status kubelet
journalctl -xeu kubelet --no-pager | grep -i "CRI"
- Mismatched versions between Kubernetes and containerd
- Forgetting to apply
systemctl daemon-reload
after config changes - Multiple container runtimes installed (docker, cri-o) causing conflicts
The error message failed to run Kubelet: validate service connection: CRI v1 runtime API is not implemented for endpoint
typically occurs when your Kubernetes node agent (kubelet) can't communicate properly with your Container Runtime Interface (CRI). This is particularly common with kubelet 1.26.0 as it defaults to using CRI v1 protocol.
From analyzing hundreds of similar cases, these are the most frequent causes:
- Outdated container runtime (Docker, containerd, or CRI-O)
- Incorrect CRI socket configuration
- Version mismatch between kubelet and container runtime
- Missing or incomplete CRI plugin implementations
Here's how I fixed this on my Ubuntu 22.04 system:
1. Verify Your Container Runtime
sudo systemctl status containerd
# OR
sudo systemctl status docker
If you're using Docker (which is common), note that since Kubernetes 1.24, Docker support requires installing cri-dockerd
separately.
2. Install/Upgrade containerd (Recommended)
sudo apt-get update
sudo apt-get install -y containerd
sudo mkdir -p /etc/containerd
containerd config default | sudo tee /etc/containerd/config.toml
sudo systemctl restart containerd
3. Configure Kubelet CRI Socket
Edit your kubelet configuration (usually at /etc/default/kubelet
):
KUBELET_EXTRA_ARGS=--container-runtime=remote \
--container-runtime-endpoint=unix:///run/containerd/containerd.sock \
--runtime-request-timeout=15m
Then reload:
sudo systemctl daemon-reload
sudo systemctl restart kubelet
4. Alternative: Install cri-dockerd
If you must use Docker:
wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.1/cri-dockerd_0.3.1.3-0.ubuntu-jammy_amd64.deb
sudo dpkg -i cri-dockerd_0.3.1.3-0.ubuntu-jammy_amd64.deb
Then update kubelet args:
KUBELET_EXTRA_ARGS=--container-runtime=remote \
--container-runtime-endpoint=unix:///var/run/cri-dockerd.sock \
--runtime-request-timeout=15m
For more detailed troubleshooting:
sudo journalctl -xu kubelet -f
sudo crictl info # Verify CRI connection
kubelet --v=4 # Enable verbose logging
Ensure your components match these versions:
Component | Minimum Version |
---|---|
kubelet | 1.26.0 |
containerd | 1.6.0+ |
cri-dockerd | 0.2.0+ |
CRI-O | 1.24.0+ |
After applying fixes, check:
sudo systemctl status kubelet
sudo kubectl get nodes # If you have kubectl configured
The kubelet should now start without the CRI v1 implementation error.