kubectl get pod -o wide
找出所有pod
kubectl describe pod app-controller-q8xtz
根据podID,查找pod启动失败的原因
Warning FailedCreatePodSandBox 8h (x26 over 8h) kubelet, yanfa11 Failed create pod sandbox: rpc error: code = Unknown desc = failed pulling image "k8s.gcr.io/pause:3.1": Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
这个是镜像没有下载成功
Warning FailedCreatePodSandBox 8h kubelet, yanfa11 Failed create pod sandbox: rpc error: code = Unknown desc = failed to set up sandbox container "2cb263d35a4d0e39574d0881225b2a38ed4c86b1d9d0b86e6e8f95fe7dbaaa5a" network for pod "app-controller-q8xtz": NetworkPlugin cni failed to set up pod "app-controller-q8xtz_default" network: open /run/flannel/subnet.env: no such file or directory
这个是flannel没有安装好,主节点上重新执行 kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml
unable to recognize "https://raw.githubusercontent.com/coreos/flannel/v0.10.0/Documentation/kube-flannel.yml": yaml: line 3: mapping values are not allowed in this context
这个是子节点执行报的错误,应该在主节点执行