解决:The connection to the server raw.githubusercontent.com was refused - did you specify the right ho

我在部署k8s集群安装fannel 时候

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

出现报错:The connection to the server raw.githubusercontent.com was refused - did you specify the right host or port?
在这里插入图片描述

原因:外网不可访问

解决办法:

https://www.ipaddress.com/查询raw.githubusercontent.com的真实IP。
在这里插入图片描述

sudo vim /etc/hosts

加入

185.199.108.133  raw.githubusercontent.com

在这里插入图片描述
再次运行

kubectl apply -f https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml

即可成功安装fannel

在这里插入图片描述

希望对各位有所帮助!

猜你喜欢

转载自blog.csdn.net/Myx74270512/article/details/130534151