Kubernetes : hostname regex failed

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?

  • MupX, graphicsmagick and env var
  • AWS cloudwatch terminal output logs
  • Docker Redis CLI Timeout
  • How do I expose port from Container to host?
  • Is there a docker registry cluster solution for private purpose?
  • Listing all version numbers of docker image
  • Android Development Dockerfile: Why Does Android SDK Manager Hang?
  • Where exactly, are files in docker container stored on the host machine
  • How to build a docker container for a java app
  • How to link two docker containers which are spawned with two different docker-compose.yml
  • Build Docker image for ARM architecture on Intel machine (Mac)
  • Why does docker mount a file with a numeric value as a directory?
  • One Solution collect form web for “Kubernetes : hostname regex failed”

    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.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.