opsnull / follow-me-install-kubernetes-cluster

和我一步步部署 kubernetes 集群
Other
7.39k stars 2.9k forks source link

error: error parsing calico.yaml: error converting YAML to JSON: yaml: line 41: did not find expected key #627

Closed haiya512 closed 3 years ago

haiya512 commented 3 years ago

文档版本 master,当前版本 文档地址贴出来了 https://github.com/opsnull/follow-me-install-kubernetes-cluster/blob/master/06-6.calico.md 运行环境:centos7 x86_64 master节点

现象描述 运行这个命令的时候kubectl apply -f calico.yaml 最后一行提示我

error: error parsing calico.yaml: error converting YAML to JSON: yaml: line 41: did not find expected key

查看kubelet 运行状态之后,显示的是:

May 26 12:06:17 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:17.864943 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:22 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:22.871093 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:27 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:27.872332 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:32 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:32.874507 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:37 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:37.876817 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:42 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:42.878379 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:47 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:47.879708 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:52 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:52.882234 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized May 26 12:06:57 zhangjun-k8s-03 kubelet[5231]: I0526 12:06:57.751991 5231 kubelet_network_linux.go:111] Not using --random-fully in the MASQUERADE rule for iptables because the local version of iptables does not support it May 26 12:06:57 zhangjun-k8s-03 kubelet[5231]: E0526 12:06:57.883465 5231 kubelet.go:2187] Container runtime network not ready: NetworkReady=false reason:NetworkPluginNotReady message:Network plugin returns error: cni plugin not initialized

不知道其他人有没有遇到这个问题

haiya512 commented 3 years ago

解决了,这个文件我下载的时候有问题,导致文件补全,格式有问题。