无法加入kubernetes集群;连接被拒绝

时间:2018-08-22 12:33:05

标签: ubuntu kubernetes vagrant

当我尝试加入集群时出现以下错误:

[preflight] running pre-flight checks
    [WARNING RequiredIPVSKernelModulesAvailable]: the IPVS proxier will not be used, because the following required kernel modules are not loaded: [ip_vs_rr ip_vs_wrr ip_vs_sh ip_vs] or no builtin kernel ipvs support: map[ip_vs_sh:{} nf_conntrack_ipv4:{} ip_vs:{} ip_vs_rr:{} ip_vs_wrr:{}]
you can solve this problem with following methods:
 1. Run 'modprobe -- ' to load missing kernel modules;
2. Provide the missing builtin kernel ipvs support

I0822 12:21:25.433590   14413 kernel_validator.go:81] Validating kernel version
I0822 12:21:25.433667   14413 kernel_validator.go:96] Validating kernel config
[discovery] Trying to connect to API Server "10.0.2.15:6443"
[discovery] Created cluster-info discovery client, requesting info from "https://10.0.2.15:6443"
[discovery] Failed to request cluster info, will try again: [Get https://10.0.2.15:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: dial tcp 10.0.2.15:6443: connect: connection refused]
[discovery] Failed to request cluster info, will try again: [Get https://10.0.2.15:6443/api/v1/namespaces/kube-public/configmaps/cluster-info: dial tcp 10.0.2.15:6443: connect: connection refused

我使用此命令初始化主服务器:

$ sudo kubeadm init --pod-network-cidr=10.244.0.0/16 –-apiserver-advertise-address=192.168.1.180 --kubernetes-version stable-1.11

要在从属节点中运行的加入命令是:

sudo kubeadm join 10.0.2.15:6443 --token 0ux20u.8atg4nwhaup80qpi --discovery-token-ca-cert-hash sha256:6cf4f16530ae7e28fba67ca7419b047e8ff36bb8e8212c9b3164eff8cad021c6

我无法ping通IP 10.0.2.15的主节点。

但是我可以成功ping通IP:192.168.2.180,该IP被设置为主VM的Vagrantfile中公共网络的静态IP。

我尝试在流浪汉文件中设置专用网络ip,用于公共网络的桥。但是它们都不起作用。

在我使用的同一台计算机上:

docker版本1.13.1和 k8s版本1.11

有人可以帮助我吗?

0 个答案:

没有答案