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
- Fixes kubernetes/kubeadm#347 Node name discovery failed on `kubeadm join`. If a node name is not explicitly provided, it will be looked up. — committed to luxas/kubernetes by erhudy 7 years ago
- Merge pull request #49825 from erhudy/bugfix/kubeadm-337-empty-node-name Automatic merge from submit-queue Fixes kubernetes/kubeadm#347: empty node name when joining nodes with kubeadm Node name di... — committed to kubernetes/kubernetes by deleted user 7 years ago
- Merge pull request #49893 from luxas/automated-cherry-pick-of-#49825-upstream-release-1.7 Automatic merge from submit-queue Automated cherry pick of #49825 Cherry pick of #49825 on release-1.7. #4... — committed to kubernetes/kubernetes by deleted user 7 years ago
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.
Actually looks to be here: https://github.com/kubernetes/kubernetes/blob/v1.7.1/cmd/kubeadm/app/preflight/checks.go#L544
Looks like the HostNameCheck for node join missed an update in https://github.com/kubernetes/kubernetes/commit/e20f5a3d05d36399b9880e371fc52ef5264500cd
Just to add an additional issue when using the --config flag and setting
nodeNamein the config (to try and get around the error) the following error is given:kubeadm.yaml
Same is happening for me.