Debug Kubernetes Installation: troubleshooting commands
37 commands in 5 groups: Kubeadm, k3s, k3d, KinD, Minikube. Click or tap any command to copy it. Official documentation: kubernetes.io.
Open in the interactive cheat sheet search, stars and every other section
Kubeadm
Diagnose control plane and kubelet issues in kubeadm clusters: service health, certificate state, CRI container status, and control plane logs.
journalctl -u kubelet -f
Stream kubelet logs (primary source for join and startup failures)
journalctl -u kubelet --since "10 minutes ago" | grep -i error
Recent kubelet errors
kubectl describe node <node>
Node conditions, taints, and event history
kubectl get events -n kube-system --sort-by='.metadata.creationTimestamp'
Recent control plane events sorted by time
crictl logs <container-id>
Container logs via CRI without kubectl
kubectl logs -n kube-system <pod>
Logs from a control plane component
kubectl logs -n kube-system <pod> --previous
Logs from a crashed control plane container
crictl ps -a
All containers via CRI (works when kubectl is unreachable)
systemctl status kubelet
Check kubelet service state
openssl x509 -in /etc/kubernetes/pki/apiserver.crt -noout -dates
Check API server certificate validity dates
k3s
Debug k3s server and agent failures: service health, configuration validation, and system event inspection.
journalctl -u k3s --since "5 minutes ago" | grep -i error
Recent k3s server errors
journalctl -u k3s-agent --since "5 minutes ago" | grep -i error
Recent k3s agent errors
k3s check-config
Validate host kernel modules and cgroups required by k3s
k3s kubectl get pods -n kube-system
System pod status via embedded kubectl
k3s kubectl get events -n kube-system --sort-by='.metadata.creationTimestamp'
Recent system events sorted by time
systemctl status k3s-agent
k3s agent service state
k3d
Inspect k3d cluster state and Docker container logs for k3s clusters running inside Docker.
kubectl get nodes
Node status after setting kubeconfig
kubectl get events -n kube-system --sort-by='.metadata.creationTimestamp'
Recent system events
docker inspect k3d-<cluster>-server-0
Full container inspect: network, mounts, and env
docker logs k3d-<cluster>-agent-0
Logs from a k3s agent container
docker logs k3d-<cluster>-server-0
Logs from the k3s server container
docker ps -a | grep k3d
Check k3d Docker container states
KinD
Debug KinD clusters by inspecting Docker node containers and diagnosing startup failures.
kubectl cluster-info --context kind-<name>
API server endpoint for the cluster
kubectl describe node <node>
Node conditions and event history
kubectl get nodes
Node status
kubectl get events --sort-by='.metadata.creationTimestamp'
Cluster events sorted by time
kubectl get pods -n kube-system
System pod status
docker inspect <kind-node-container>
Full container inspect: mounts and networking
docker logs <kind-node-container>
Logs from a kind node container
docker ps -a | grep kind
Check kind Docker container states
Minikube
Diagnose minikube failures: stream cluster logs, inspect the node, and check system pod health.
minikube kubectl -- get events --sort-by='.metadata.creationTimestamp'
Cluster events using bundled kubectl
minikube kubectl -- get pods -n kube-system
System pod status using bundled kubectl
minikube logs
Print all minikube logs
minikube logs | grep -i error
Filter error lines from minikube logs
minikube ssh -- df -h
Disk usage inside the minikube node
minikube ssh -- sudo crictl ps -a
All container states inside the minikube node
minikube ssh -- sudo journalctl -u kubelet -f
Stream kubelet logs from inside the minikube node