diff --git a/data/data/bootstrap/baremetal/README.md b/data/data/bootstrap/baremetal/README.md index 7f6275e7ee5..6efc75e5b1c 100644 --- a/data/data/bootstrap/baremetal/README.md +++ b/data/data/bootstrap/baremetal/README.md @@ -14,30 +14,6 @@ bootstrap assets in more detail. server. This VIP first resides on the bootstrap VM. Once the master nodes come up, the VIP will move to the control plane machines. -Relevant files: -* **[files/etc/keepalived/keepalived.conf.tmpl](files/etc/keepalived/keepalived.conf.tmpl)** - - `keepalived` configuration template - * *NOTE:* The extension is `.tmpl` instead of `.template`, as the templating - is done by `envsubst` in `keepalived.sh` and not via go templating in the - installer. -* **[files/usr/local/bin/keepalived.sh](files/usr/local/bin/keepalived.sh)** - - This script runs before `keepalived` starts and generates the `keepalived` - configuration file from the template. -* **[systemd/units/keepalived.service](systemd/units/keepalived.service)** - - systemd unit file for `keepalived`. This runs `keepalived.sh` to generate the - proper configuration from the template and then runs podman to launch - `keepalived`. -* **[files/usr/local/bin/fletcher8](files/usr/local/bin/fletcher8)** - Script - that uses the - [fletcher8](https://en.wikipedia.org/wiki/Fletcher%27s_checksum) algorithm to - generate a hash from an input string. This is used by `keepalived.sh` to - generate a hash based on the cluster name to generate VRRP ids for use with - Keepalived and to ensure those IDs do not clash with another cluster on the - same network. -* **[files/usr/local/bin/get_vip_subnet_cidr](files/usr/local/bin/get_vip_subnet_cidr)** - - Script to determine the network CIDR for a given VIP. This is used by - `keepalived.sh` to determine which local interface is on the VIP’s network. - ## Internal DNS The bootstrap assets relating to DNS automate as much of the DNS requirements @@ -51,21 +27,5 @@ dynamically generate the DNS SRV record for `etcd`, as well as resolve the `etcd` hostnames. Relevant files: -* **[files/etc/keepalived/keepalived.conf.tmpl](files/etc/keepalived/keepalived.conf.tmpl)** - - `keepalived` configuration template, includes configuration for the DNS VIP - * *NOTE:* The extension is `.tmpl` instead of `.template`, as the templating - is done by `envsubst` in `keepalived.sh` and not via go templating in the - installer. * **[files/etc/dhcp/dhclient.conf](files/etc/dhcp/dhclient.conf)** - Sepcify that the bootstrap VM should use `localhost` as its primary DNS server. -* **[files/etc/coredns/Corefile](files/etc/coredns/Corefile)** - This is a - template for a CoreDNS configuration file. - * Includes a static entry for `api-int` - * Enables the `mdns` plugin for dynamic `etcd` resolution - * Forwards other queries along to the originally configured DNS server for - that host -* **[files/usr/local/bin/coredns.sh](files/usr/local/bin/coredns.sh)** - A - script to prepare the CoreDNS configuration -* **[systemd/units/coredns.service](systemd/units/coredns.service)** - systemd - unit that launches CoreDNS via podman after first running `coredns.sh` to - prepare the configuration diff --git a/data/data/bootstrap/baremetal/files/usr/local/bin/fletcher8 b/data/data/bootstrap/baremetal/files/usr/local/bin/fletcher8 deleted file mode 100755 index c3043b20968..00000000000 --- a/data/data/bootstrap/baremetal/files/usr/local/bin/fletcher8 +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/libexec/platform-python - -# Script that uses the fletcher8 algorithm to generate a hash from an input -# string. This is used to generate VRRP ids for use with Keepalived. -# -# https://en.wikipedia.org/wiki/Fletcher%27s_checksum - -import sys - -data = map(ord, sys.argv[1]) -ckA = ckB = 0 - -for b in data: - ckA = (ckA + b) & 0xf - ckB = (ckB + ckA) & 0xf -print((ckB << 4) | ckA ) diff --git a/data/data/bootstrap/baremetal/files/usr/local/bin/get_vip_subnet_cidr b/data/data/bootstrap/baremetal/files/usr/local/bin/get_vip_subnet_cidr deleted file mode 100755 index 12e5c6afc15..00000000000 --- a/data/data/bootstrap/baremetal/files/usr/local/bin/get_vip_subnet_cidr +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/libexec/platform-python - -# Script to determine the network CIDR for a given VIP. - -import sys -import socket -import struct - -vip = sys.argv[1] -iface_cidrs = sys.argv[2].split() -vip_int = struct.unpack("!I", socket.inet_aton(vip))[0] - -for iface_cidr in iface_cidrs: - ip, prefix = iface_cidr.split('/') - ip_int = struct.unpack("!I", socket.inet_aton(ip))[0] - prefix_int = int(prefix) - mask = int('1' * prefix_int + '0' * (32 - prefix_int), 2) - subnet_ip_int_min = ip_int & mask - subnet_ip = socket.inet_ntoa(struct.pack("!I", subnet_ip_int_min)) - subnet_ip_int_max = subnet_ip_int_min | int('1' * (32 - prefix_int), 2) - subnet_ip_max = socket.inet_ntoa(struct.pack("!I", subnet_ip_int_max)) - sys.stderr.write('Is %s between %s and %s\n' % (vip, subnet_ip, subnet_ip_max)) - if subnet_ip_int_min < vip_int < subnet_ip_int_max: - subnet_ip = socket.inet_ntoa(struct.pack("!I", subnet_ip_int_min)) - print('%s/%s' % (subnet_ip, prefix)) - sys.exit(0) -sys.exit(1)