I'm going to change the architecture of the provisioning process. Up to now I planned that the ansible scripts provision the gateway as well as the nodes, assuming that the nodes are set up upfront with pre-defined hostnames and added to the ansible inventory file.
That complicates the provisioning of hosts as we have lots of manual steps and a rather static infrastructure. What I want: being able to just add a new hardware node to the network switch, boot it up (either via PXE oder a bootable usb stick) and let it be installed & added to k8s automatically.
For this to work we change the provisioning process:
the initial ansible scripts just provision & configure the gateway (dnsmasq for dns + dhcp + pxe/tftp)
dnsmasq is configured with dhcp-range to give new nodes IPs with infinite lease time
the gateway's /etc/hosts file is pre-populated with entries for all IPs in the dhcp-range -> new hosts get a pre-defined hostname from /etc/hosts, e.g. k8s-node-XXX (XXX being the last segment of the IP address)
whenever a new dhcp lease is handed out by dnsmasq a custom script is called on the gateway which adds the new node to a ansible inventory file and starts a ansible playbook to provision the new node
In this ticket the dnsmasq config and /etc/hosts is changed to reflect this dynamic infinite lease mechanism.
I'm going to change the architecture of the provisioning process. Up to now I planned that the ansible scripts provision the gateway as well as the nodes, assuming that the nodes are set up upfront with pre-defined hostnames and added to the ansible inventory file. That complicates the provisioning of hosts as we have lots of manual steps and a rather static infrastructure. What I want: being able to just add a new hardware node to the network switch, boot it up (either via PXE oder a bootable usb stick) and let it be installed & added to k8s automatically.
For this to work we change the provisioning process:
In this ticket the dnsmasq config and /etc/hosts is changed to reflect this dynamic infinite lease mechanism.