You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The /etc/hosts files generated by kubespray are useful, but actually use an incorrect (but common) syntax, for example:
# Ansible inventory hosts BEGIN
10.0.1.20 kubeadmin kubeadmin.example.org
10.0.1.21 kube01 kube01.example.org
10.0.1.22 kube02 kube02.example.org
# Ansible inventory hosts END
Notice how the short domain name (e.g. kubeadmin) is before the fully-qualified domain name (FQDN, kubeadmin.example.org).
This is, arguably, a very minor difference, but it has an impact over unrelated components. For example, hostname -f does not return the right domain name:
$ hostname
kubeadmin
$ hostname -f
kubeadmin
A properly configured host would return a FQDN for hostname -f, like this:
The hosts(5) manpage clearly states that the first entry is the
"canonical name", or FQDN (Fully-Qualified Domain Name):
IP_address canonical_hostname [aliases...]
By using the alias as a first entry, `hostname -f` does not return the
correct domain which breaks all sorts of unrelated functionality (it
has impact over email server configuration, for example).
The
/etc/hostsfiles generated by kubespray are useful, but actually use an incorrect (but common) syntax, for example:Notice how the short domain name (e.g.
kubeadmin) is before the fully-qualified domain name (FQDN,kubeadmin.example.org).This is, arguably, a very minor difference, but it has an impact over unrelated components. For example,
hostname -fdoes not return the right domain name:A properly configured host would return a FQDN for
hostname -f, like this:The /etc/hosts manual page is pretty clear on the topic:
The EXAMPLES section is similarly unambiguous: the FQDN comes first.
Reversing those domain names in the
/etc/hostsfile will fix that problem, for which I will submit a PR shortly.Environment:
printf "$(uname -srm)\n$(cat /etc/os-release)\n"): Linux 4.9.0-7-amd64 x86_64 Debian GNU/Linux 9 (stretch)ansible --version): N/AKubespray version (commit) (
git rev-parse --short HEAD): v2.5.0 (but also applies to later versions)Network plugin used: calico
Copy of your inventory file:
Command used to invoke ansible:
Output of ansible run:
N/A
The text was updated successfully, but these errors were encountered: