kubeadm: kubeadm join failing preflight checks

Is this a BUG REPORT or FEATURE REQUEST?

BUG REPORT

Versions

kubeadm version: &version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.1", GitCommit:"1dc5c66f5dd61da08412a74221ecc79208c2165b", GitTreeState:"clean", BuildDate:"2017-07-14T01:48:01Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

Environment:

  • Kubernetes version Client Version: version.Info{Major:"1", Minor:"7", GitVersion:"v1.7.1", GitCommit:"1dc5c66f5dd61da08412a74221ecc79208c2165b", GitTreeState:"clean", BuildDate:"2017-07-14T02:00:46Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
  • Cloud provider or hardware configuration: AWS
  • OS (e.g. from /etc/os-release): CentOS Linux release 7.3.1611 (Core)

What happened?

[root@ip-192-168-99-11 ~]# kubeadm join --token random.16charactertoken 192.168.99.10: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`

What you expected to happen?

Normal completion of kubeadm join

How to reproduce it (as minimally and precisely as possible)?

Try to perform kubeadm join with v1.7…1

Anything else we need to know?

Skipping preflight checks allows the join to run normally.

I suspect the problem is this line: https://github.com/kubernetes/kubernetes/blob/v1.7.1/cmd/kubeadm/app/preflight/checks.go#L544

It was not updated to match the changes to HostnameCheck in https://github.com/kubernetes/kubernetes/commit/e20f5a3d05d36399b9880e371fc52ef5264500cd So it always passes in an empty string and always fails the updated HostnameCheck.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 21 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Right, just writing it up here in the event that there was some grander reason for restructuring it that I don’t know about. I will work up a PR.

Just to add an additional issue when using the --config flag and setting nodeName in the config (to try and get around the error) the following error is given:

[root@node1 ~]# kubeadm join --config=/etc/kubernetes/kubeadm.yaml
[kubeadm] WARNING: kubeadm is in beta, please do not use it for production clusters.
[preflight] Running pre-flight checks
can not mix '--config' with other arguments

kubeadm.yaml

kind: NodeConfiguration
apiVersion: kubeadm.k8s.io/v1alpha1
nodeName: node1.k8s1.vmw.rmb938.me
token: nope
discoveryTokenAPIServers:
  - master.rmb938.me:6443

Same is happening for me.