Kubernetes : hostname regex failed

2/23/2017

Trying to run kubeadm init

[root@ts_kubernetes_setup ~]# kubeadm init
[kubeadm] WARNING: kubeadm is in alpha, please do not use it for production clusters.
[preflight] Running pre-flight checks
[preflight] WARNING: firewalld is active, please ensure ports [6443 9898 10250] are open or your cluster may not function correctly
[preflight] Some fatal errors occurred:
        hostname "ts_kubernetes_setup.localdomain" must match the regex [a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)* (e.g. 'example.com')
[preflight] If you know what you are doing, you can skip pre-flight checks with `--skip-preflight-checks`
[root@ts_kubernetes_setup ~]#

Shows error on hostname. Can i run kudeadm on this machine?

-- verma_neeraj
containers
docker
hostname
kubernetes
linux

1 Answer

2/23/2017

You could use a different name other than the hostname with the --api-external-dns-names as described in the reference manual. E.g.:

kubeadm init --api-external-dns-names=kube.local

This should run just fine.

You could also change the hostname of your machine - you'll find plenty of ways to do that on SO too.

-- pagid
Source: StackOverflow