[k8s deployment] k8s failed to build the Flannel network plug-in. The connection to the server raw.githubusercontent.com was refused problem solution

Hello everyone, I am a studious junior. I have recently been learning to build a k8s cluster. The method I used is based on kubeadm. When building the Flannel network, an error occurred.

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?

Analysis of the reason: Because of the mysterious power, the domain name cannot be resolved, so it cannot be accessed.

Solution: Log in without a domain name, log in directly with IP, or set up domain name resolution in /etc/hosts

step:

1. Query the IP corresponding to raw.githubusercontent.com through a third-party website

      【Query Website】Webmaster’s Home

 2. Fill in the following content in /etc/hosts. It is best to use the latest IP found on the website.

vim /etc/hosts

185.199.109.133  raw.githubusercontent.com

3. Execute the installation statement again

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

4. Successfully installed

 5. kubectl get nodes #Check whether the status is started

 6. After the download and installation is completed, the domain name can be deleted.


It’s not easy for newcomers to create. If you think it’s good, please give it a thumbs up! ! !

Please indicate the source when reprinting!

                                                                 

 

Guess you like

Origin blog.csdn.net/weixin_43784564/article/details/124721760