Short answer up front: that “rpc error: code = Unavailable … transport: Error while dialing” when all three runtimes endpoints fail almost always means the container runtime on the node isn’t reachable by the Kubelet. Since etcd is started as a static pod controlled by the Kubelet, if the runtime can’t be talked to, etcd won’t be created. The fix is to get the runtime (containerd by default, or CRI-O/cri-docker if you configured it) up and reachable, or correct the runtime endpoint that the Kubelet is using.
What’s most likely going on
- The container runtime is not running or not listening on the expected socket(s):
- /run/containerd/containerd.sock (containerd)
- /run/crio/crio.sock (CRI-O)
- /var/run/cri-docker.sock (cri-docker)
- The Kubelet is configured to talk to a runtime-endpoint that doesn’t match the actual runtime/socket on the node.
- The etcd image from the preloaded tarball hasn’t been loaded, or the etcd image referenced by etcd.yaml isn’t present, so the pod can’t be started even if the runtime is reachable.
- There are runtime-specific issues (permissions, SELinux/AppArmor, resource constraints) causing the runtime to crash or refuse the connection.
Troubleshooting and recovery steps (practical, step-by-step)
- Gather quick evidence
- Check rke2 and system logs
- sudo journalctl -u rke2-server -b | tail -n 200
- sudo journalctl -u rke2-server -b --no-pager
- Look for etcd-related errors in the logs
- sudo grep -R "etcd" /var/log/rke2* 2>/dev/null || true
- Verify runtime sockets and runtime processes
- Do the sockets exist?
- ls -l /run/containerd/containerd.sock
- ls -l /run/crio/crio.sock
- ls -l /var/run/cri-docker.sock
- Are any runtimes actually running?
- ps -ef | egrep -i 'containerd|crio|cri-docker' | grep -v grep
- If you’re on a system that uses separate services for the runtime, check:
- systemctl status containerd crio cri-docker
- If none of these sockets exist or runtimes aren’t running, you likely have a runtime startup issue. Restart the node or the RKE2 server to reinitialize the runtime bootstrap:
- sudo systemctl restart rke2-server
- If needed, use the built-in reset/kill script:
- sudo /usr/local/bin/rke2-killall.sh
- sudo systemctl restart rke2-server
- Confirm what runtime endpoint the Kubelet is using
- Inspect the kubelet command line to see what runtime-endpoint is configured:
- ps -ef | grep kubelet | grep -v grep
- If you can’t see it plainly, get the kubelet’s actual cmdline:
- sudo cat /proc/$(pidof kubelet)/cmdline | tr '\0' ' '
- Look in RKE2 config for runtime endpoint overrides:
- cat /etc/rancher/rke2/config.yaml | grep -i endpoint -n
- Also check any systemd drop-ins for rke2-server that pass kubelet args (e.g., --container-runtime-endpoint). If you find a mismatch, correct it to the actual runtime socket path and restart:
- sudo systemctl restart rke2-server
- Validate the container runtime is usable from the host
- Try a runtime query with crictl (the RKE2 bundle includes crictl):
- sudo /var/lib/rancher/rke2/bin/crictl version
- sudo /var/lib/rancher/rke2/bin/crictl info
- sudo /var/lib/rancher/rke2/bin/crictl ps -a
- sudo /var/lib/rancher/rke2/bin/crictl pods -A
- If crictl cannot talk to the runtime, you’ll know the runtime is not ready. Fix the runtime (start service, fix endpoint) and re-run.
- Check that the etcd image is available
- Verify the preloaded images tarball was loaded and that etcd is present in the image list:
- sudo /var/lib/rancher/rke2/bin/crictl image ls
- Check the tarball location, e.g. /var/lib/rancher/rke2/agent/images or the tarball named something like rke2-images.linux-amd64.tar.zst
- If etcd image is missing, re-load the tarball (or re-run the install in an air-gapped environment) and restart:
- Re-load tarball as per your environment, then:
- sudo systemctl restart rke2-server
- Inspect the etcd pod manifest and pod creation path
- The etcd static pod manifest is usually generated into the pod manifests dir:
- cat /var/lib/rancher/rke2/agent/pod-manifests/etcd.yaml
- If the file is present but the container runtime can’t start it, check the container runtime’s logs for image pull or creation errors:
- sudo /var/lib/rancher/rke2/bin/crictl ps -a
- sudo /var/lib/rancher/rke2/bin/crictl logs (get the ID from crictl ps)
- If the etcd image is conflicting or corrupted, you may need to re-load images and re-create the pod manifest.
- Resource, permissions, and safety checks
- Ensure sufficient memory and CPU for etcd and the control plane components.
- Check SELinux/AppArmor policies that might prevent container runtimes from starting or mounting volumes.
- If the node is under heavy resource pressure, consider temporarily scaling down workloads or freeing memory.
- If you still can’t get etcd created
- Collect a fuller log snapshot and share it, focusing on:
- The moment etcd.yaml is generated
- The runtime connection attempts
- Any image pull/load errors
- As a last resort, you can reset the node and reinstall RKE2 on that node:
- sudo /usr/local/bin/rke2-killall.sh
- sudo rm -rf /etc/rancher/rke2 /var/lib/rancher/rke2
- Re-run your usual RKE2 install script
Helpful quick-references (commands you’ll likely reuse)
- Check RKE2 server status and recent logs:
- sudo systemctl status rke2-server
- sudo journalctl -u rke2-server -b --no-pager
- Check container runtime sockets:
- ls -l /run/containerd/containerd.sock
- ls -l /run/crio/crio.sock
- ls -l /var/run/cri-docker.sock
- Inspect kubelet args (runtime endpoint):
- ps -ef | grep kubelet | grep -v grep
- Inspect etcd manifest and images:
- cat /var/lib/rancher/rke2/agent/pod-manifests/etcd.yaml
- sudo /var/lib/rancher/rke2/bin/crictl image ls
- sudo /var/lib/rancher/rke2/bin/crictl ps -a
If you want, I can tailor these steps to your exact environment. Tell me:
- Your OS (e.g., RHEL/CentOS 7/8, Ubuntu 20.04, etc.)
- RKE2 version
- Whether you’re using containerd by default or had changed to CRI-O / cri-docker
- Any recent changes to /etc/rancher/rke2/config.yaml or systemd drop-ins
- The output of a few key commands (logs snippet, socket presence, kubelet cmdline)
I can synthesize a concise, node-specific runbook from those.