kubernetes v1.7.1 kubeadm加入主机名“"无法达到错误 [英] kubernetes v1.7.1 kubeadm join hostname "" could not be reached error
本文介绍了kubernetes v1.7.1 kubeadm加入主机名“"无法达到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
今天,当我运行kubeadm join --token 189518.c21306e71082d6ec
命令时,使用v1.7.1重新创建了集群,它给出了以下错误.这用于kubernetes的早期版本中的工作.此版本中有什么变化,我们该如何解决?
Today I recreated my cluster with v1.7.1 when I run the kubeadm join --token 189518.c21306e71082d6ec
command, it giving the below error. this used work in previous version of kubernetes. Is something changed in this version, How do we resolve this?
[root@k8s17-02 ~]# kubeadm join --token 189518.c21306e71082d6ec 192.168.15.91:6443
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[preflight] Running pre-flight checks
[preflight] WARNING: hostname "" could not be reached
[preflight] WARNING: hostname "" lookup : no such host
[preflight] Some fatal errors occurred:
hostname "" a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
[preflight] If you know what you are doing, you can skip pre-flight checks with `--skip-preflight-checks`
17年7月21日更新
还在v1.7.2相同的问题上对此进行了测试.
Tested this with v1.7.2 same issue still.
# ./kubeadm version
kubeadm version: &version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.2", GitCommit:"922a86cfcd65915a9b2f69f3f193b8907d741d9c", GitTreeState:"clean", BuildDate:"2017-07-21T08:08:00Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
# ./kubeadm join --token 189518.c21306e71082d6ec 192.168.15.91:6443
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[preflight] Running pre-flight checks
[preflight] WARNING: hostname "" could not be reached
[preflight] WARNING: hostname "" lookup : no such host
[preflight] Some fatal errors occurred:
hostname "" a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')
[preflight] If you know what you are doing, you can skip pre-flight checks with `--skip-preflight-checks`
谢谢 SR
推荐答案
它似乎正在尝试查找主机名,但不能,因为它不在DNS中.有两种解决方法:
Looks like it's trying to look up the hostname and can't because it's not in DNS. There are two ways around this:
- Kubernetes与命名节点配合使用效果更好.虽然这很烦人,但从长远来看,它提供了很多好处,例如,当您必须在重新启动时使用不同的IP地址时.您可以在每台计算机上编辑
/etc/hosts
,以为群集中的所有框提供名称,或者启动本地DNS,将名称添加到其中. - 或者,您可以尝试跳过飞行前检查...
kubeadm join --skip-preflight-checks --token TOKEN HOST:PORT
- Kubernetes works better with named nodes. While this is annoying, it provides benefits in the long run, such as when you have to use different IP addresses on a reboot. You could edit
/etc/hosts
on each machine to give names to all the boxes in your cluster, or start up a local DNS, adding the names to that. - Or, you could try skipping the preflight checks...
kubeadm join --skip-preflight-checks --token TOKEN HOST:PORT
这篇关于kubernetes v1.7.1 kubeadm加入主机名“"无法达到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文