We'll be working on the Servers that are surrounded by the continous lines in this drawing:
Setting up DHCP for the cluster is probably the easiest and shortest task. All we need to do is add a reservation for each node in the cluster that is running CoreOS, in my case that's just 6 static reservations.
Since I'll be hosting this cluster in my homelab and will provide the infrastructure myself, I'll manually assign the mac-addresses. A static lease will look like this:
host bootstrap.okd {
hardware ethernet 52:54:00:0f:0f:00;
fixed-address 172.31.10.150;
}
I'd like to explain it for a minute so there's no confusion on why I'm adding the clustername to the nodename. With my DHCP Setup, I've set 'option domain-name "archyslife.lan"' so I'm using the clustername / subdomain for the cluster here as well in each host definition. For reference, this is my full subnet declaration:
subnet 172.31.10.0 netmask 255.255.255.0 {
range 172.31.10.100 172.31.10.199;
option routers 172.31.10.254;
option subnet-mask 255.255.255.0;
option domain-search "archyslife.lan";
option domain-name "archyslife.lan";
option domain-name-servers 172.31.10.5, 172.31.10.6, 172.31.10.7;
option ntp-servers 172.31.10.5, 172.31.10.6, 172.31.10.7;
option broadcast-address 172.31.10.255;
next-server 172.31.10.10;
if option architecture-type = 00:07 {
filename "grub2/grubx64.efi";
} else {
filename "pxelinux.0";
}
}
Now, let's get to configuring the static leases for each node:
[archy@infra01 ~]$ sudo vim /etc/dhcp/dhcpd.conf
host bootstrap.okd {
hardware ethernet 52:54:00:0f:0f:00;
fixed-address 172.31.10.150;
}
host master01.okd {
hardware ethernet 52:54:00:0f:0f:01;
fixed-address 172.31.10.151;
}
host master02.okd {
hardware ethernet 52:54:00:0f:0f:02;
fixed-address 172.31.10.152;
}
host master03.okd {
hardware ethernet 52:54:00:0f:0f:03;
fixed-address 172.31.10.153;
}
host worker01.okd {
hardware ethernet 52:54:00:0f:0f:04;
fixed-address 172.31.10.154;
}
host worker02.okd {
hardware ethernet 52:54:00:0f:0f:05;
fixed-address 172.31.10.155;
}
Now, restart the service to make the changes take effect: [archy@infra01 ~]$ sudo systemctl restart dhcpd.service
Comments
Post a Comment