rootsongjc/kubernetes-vagrant-centos-cluster

The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?

GaryQiao opened this issue · 4 comments

环境:
OS: win10
Kubernetes version: v1.21.1
VirtualBox version: VirtualBox-5.2.26-128414-Win
Vagrant version: 2.2.16
操作:
kubernetes-server-linux-amd64.tar.gz 已经参照readme说明放置在根路径下了
错误:

node3: configure node3
    node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kubelet.service to /usr/lib/systemd/system/kubelet.service.
    node3: Created symlink from /etc/systemd/system/multi-user.target.wants/kube-proxy.service to /usr/lib/systemd/system/kube-proxy.service.
    node3: deploy coredns
    node3: /tmp/vagrant-shell: ./dns-deploy.sh: /bin/bash^M: bad interpreter: No such file or directory
    node3: The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
    node3: /home/vagrant
    node3: deploy kubernetes dashboard
    node3: The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
    node3: create admin role token
    node3: The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
    node3: the admin role token is:
    node3: The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
    node3: The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
    node3: login to dashboard with the above token
    node3: The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
    node3: https://172.17.8.101:
    node3: install traefik ingress controller
    node3: The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
    node3: Configure Kubectl to autocomplete

请问是版本不兼容的问题吗?

log.txt

这是完整的日志

./dns-deploy.sh 这个文件添加进去了吗?

$ vagrant ssh node3
[vagrant@node3 ~]$ sudo -i
[root@node3 ~]# cd /vagrant/addon/dns
[root@node3 dns]# yum -y install dos2unix
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-
: manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile
Package dos2unix-6.0.3-7.el7.x86_64 already installed and latest version
Nothing to do
[root@node3 dns]# dos2unix dns-deploy.sh
dos2unix: converting file dns-deploy.sh to Unix format ...
[root@node3 dns]# ./dns-deploy.sh -r 10.254.0.0/16 -i 10.254.0.2 |kubectl apply -f -
The connection to the server 172.17.8.101:6443 was refused - did you specify the right host or port?
[root@node3 dns]# ls
coredns.yaml.sed dns-deploy.sh
[root@node3 dns]#

文档的解决方案测试了,没有解决

您好,我把Kubernetes 版本换成1.15.0就可以了,感谢解答