在GCP上使用k8引导主节点时出现问题

时间:2019-04-29 05:35:40

标签: kubernetes google-cloud-platform

在GCP中,我们正在设置kubernetes 1.14。 HA是Stacked etcd拓扑。

我们创建了一个安装kubernetes二进制文件的映像。

我们有terrafrom脚本,其中使用上述图像使用3个主节点和5个工作节点创建了一个实例组。

此外,在terrafrom脚本中,我们创建了启用了6443端口的TCP负载平衡。

我可以通过运行kubeadm init --config =来引导一个主服务器。但是,加入第二个主服务器失败,并出现以下错误。

kubeadm join XX.XX.XX.XX:6443 --token 9a08jv.c0izixklcxtmnze7 --discovery-token-ca-cert-hash sha256:73390a94962247546282a0954cb46f2a282b00534c06aff93773f3fc50aee562 --experimental-control-plane -v 8

日志

I0423 09:50:33.623004 21078 checks.go:382] validating the presence of executable touch
I0423 09:50:33.623063 21078 checks.go:524] running all checks
I0423 09:50:33.656532 21078 checks.go:412] checking whether the given node name is reachable using net.LookupHost
I0423 09:50:33.656705 21078 checks.go:622] validating kubelet version
I0423 09:50:33.716178 21078 checks.go:131] validating if the service is enabled and active
I0423 09:50:33.723119 21078 checks.go:209] validating availability of port 10250
I0423 09:50:33.723377 21078 checks.go:439] validating if the connectivity type is via proxy or direct
I0423 09:50:33.723445 21078 join.go:441] [preflight] Fetching init configuration
I0423 09:50:33.723486 21078 join.go:474] [preflight] Retrieving KubeConfig objects
[preflight] Reading configuration from the cluster…
[preflight] FYI: You can look at this config file with ‘kubectl -n kube-system get cm kubeadm-config -oyaml’
I0423 09:50:33.725538 21078 round_trippers.go:416] GET https://XX.XX.XX.XX:6443/api/v1/namespaces/kube-system/configmaps/kubeadm-config
I0423 09:50:33.725564 21078 round_trippers.go:423] Request Headers:
I0423 09:50:33.725570 21078 round_trippers.go:426] Accept: application/json, /
I0423 09:50:33.725594 21078 round_trippers.go:426] User-Agent: kubeadm/v1.14.0 (linux/amd64) kubernetes/641856d
I0423 09:50:33.725886 21078 round_trippers.go:441] Response Status: in 0 milliseconds
I0423 09:50:33.725903 21078 round_trippers.go:444] Response Headers:

错误执行阶段预检:无法获取kubeadm-config ConfigMap:无法获取配置映射:Get https://XX.XX.XX.XX:6443/api/v1/namespaces/kube-system/configmaps/kubeadm-config:拨打tcp XX.XX.XX.XX:6443:connect:连接被拒绝

请注意,我们在NLB Loadbalacer中也遇到了相同的问题,我们能够通过使用Classic Loadbalacer来解决此问题

预先感谢您的帮助。

0 个答案:

没有答案
相关问题