adds FQDN for better acces remote kubectl clients
To be able to use kubectl from an external machine, I would like to propose to add the control plane endpoint.
@ekerkenaar fqdn might not work if the DNS setup for that host, not sure what is use case you're looking at ?
You are correct. This will not work when there is no DNS set up for that host.
The case I'm looking at is to connect from my laptop to a machine, by name instead of an IP address, which is running the cloud-native-stack (we always use DNS names, not just IP addresses). This allows administrators to connect to the machine with kubectl from their laptops without having to deal with errors about common names on the certificates not matching the domain name.
Maybe something like {% if ansible_fqdn is defined %}{{ ansible_fqdn }}{% elif ansible_hostname is defined %}{{ ansible_hostname }}{% else %}{{ ansible_host }}{% endif %} would be more appropriate? I haven't tested this though...
But that way there's a fallback.
we tested on our environment which doesn't have DNS for static set up, then in that case it's failing
but you want to perform the step you can do after the installation for /etc/kubernetes/manifests and reload the kubelet will help