Kubernetes Dashboard Pod处于ContainerCreating状态无法运行求助
Hey there, let's work through this Kubernetes Dashboard pod stuck in ContainerCreating state together. I’ve run into similar issues plenty of times, so here’s a step-by-step troubleshooting guide to get you sorted:
The most straightforward way to find the root cause is to look at the pod's event history. Run this command:
kubectl describe pod kubernetes-dashboard-5bd6f767c7-v5g8q -n kube-system
Scroll down to the Events section—this will tell you exactly what’s going wrong:
- If you see
ImagePullBackOfforErrImagePull, the dashboard image is failing to download - If there are errors related to volumes or network, that points to storage/CNI issues
- Resource-related errors mean your node doesn’t have enough CPU/memory to run the pod
Sometimes the pod can’t start because the node is out of resources. Check your node’s resource usage with:
kubectl top nodes
Or get more detailed node info:
kubectl describe node <your-node-name>
If CPU/memory is maxed out, you’ll need to clean up unused pods on the node or add more nodes to your cluster.
The default Kubernetes Dashboard image is hosted on Google’s registry, which can be slow or blocked in some regions. First, confirm the image your pod is trying to pull:
kubectl get pod kubernetes-dashboard-5bd6f767c7-v5g8q -n kube-system -o jsonpath='{.spec.containers[0].image}'
Try pulling this image manually on your node with docker pull <image-name>. If it fails, replace the image with a domestic mirror (like Alibaba Cloud’s). Update the deployment with:
# Replace the image tag with the one from your pod kubectl set image deployment/kubernetes-dashboard kubernetes-dashboard=registry.cn-hangzhou.aliyuncs.com/google_containers/kubernetes-dashboard-amd64:v2.7.0 -n kube-system
If your cluster’s network plugin (like Flannel, Calico, or Weave) isn’t running properly, pods can’t get network interfaces and will stay stuck in ContainerCreating. Check the network pods:
kubectl get pods -n kube-system | grep -E 'flannel|calico|weave'
If any of these pods aren’t in Running state, fix the network plugin first—without working networking, most pods won’t start.
If none of the above works, check the kubelet logs on the node where the dashboard pod is scheduled. Kubelet handles pod creation and will log detailed errors:
# On systemd-based nodes journalctl -u kubelet -f
Look for lines related to the dashboard pod—this will often reveal hidden issues like permission problems or storage mount failures.
Also, note that the kubectl logs error you’re seeing is expected: the pod hasn’t started its container yet, so there are no logs to retrieve. Always start with kubectl describe for stuck pods!
内容的提问来源于stack exchange,提问作者Snipper03

