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?

  • how do I clean up my docker host machine
  • How to add my container's hostname to /etc/hosts?
  • Authentication is required error during automated build in docker hub
  • sed inline replacement not working from Dockerfile
  • Docker Container Networking with Docker-in-Docker
  • Docker run ignore stderr error messages
  • Multiple services to run on a container or multiple containers Docker?
  • Understanding how to import a map.osm file into a postgres database.
  • Docker and Rails environments
  • Build postgres docker container with initial schema
  • Proxying Docker Containers as Subdomains
  • How to get into container using GUI tool (like Kitematic) in Docker?
  • 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.