To run multiple OpenShift clusters from one bastion requires managing dhcpd, named, http, haproxy with isolated configurations.
After deploying with ocp4-upi-powervm, you can ‘move’ the configuration over
-
dhcpdenables booting the rhcos nodes, which then can grab their configuration.dhcpdsupportincludestatements, allowing you to split subnets, host reservations, and cluster-specific configurations into separate files.- Create the
conf.ddirectory:mkdir -p /etc/dhcp/conf.d - Modify your main
/etc/dhcp/dhcpd.confto include the directory. Add this at the bottom of the file:include "/etc/dhcp/conf.d/ocp-cluster-1.conf"; - Create the file
/etc/dhcp/conf.d/ocp-cluster-1.conf– you’ll have to give the host unique names.
subnet 10.20.176.0 netmask 255.255.240.0 { interface eth0; # Static entries host bootstrap { hardware ethernet fa:16:3e:ff:b7:b2; fixed-address 10.20.188.84; } host master-0 { hardware ethernet fa:16:3e:9b:c5:89; fixed-address 10.20.188.206; } host master-1 { hardware ethernet fa:16:3e:b7:ba:16; fixed-address 10.20.188.62; } host master-2 { hardware ethernet fa:16:3e:14:2c:ff; fixed-address 10.20.188.166; } host worker-0 { hardware ethernet fa:16:3e:97:7b:1b; fixed-address 10.20.188.79; } host worker-1 { hardware ethernet fa:16:3e:62:39:fe; fixed-address 10.20.188.234; } host worker-2 { hardware ethernet fa:16:3e:23:54:0a; fixed-address 10.20.188.131; } # this will not give out addresses to hosts not listed above #deny unknown-clients; # this is PXE specific filename "boot/grub2/powerpc-ieee1275/core.elf"; next-server 10.20.188.128; }- Restart the systemd service
systemctl restart dhcpd
- Create the
-
If you are hosting ignition files on httpd on port 8080.
- Create the ignition folder
mkdir -p /var/www/html/ignition/{ocp-cluster-1,ocp-cluster-2} - Copy the ignition files into
/var/www/html/ignition/ocp-cluster-# - Or Download the ignitions
curl -k -H "Accept: application/vnd.coreos.ignition+json;version=3.4.0" -o /var/www/html/ignition/power.ign https://api-int.XYZ.powervs-openshift-ipi.cis.ibm.net:22623/config/power - Restore selinux
restorecon -r /var/www/html/ignition
- Create the ignition folder
-
HAProxyallows us to use separateuse_backendandacl- Edit
/etc/haproxy/haproxy.cfg - Add acl for the domain name based on hostname
frontend https-all mode tcp option tcplog bind *:443 acl 02-https-ci req_ssl_sni -m end .mycluster1.ibm.net use_backend https-workers-02 if 02-https-ci acl 03-https req_ssl_sni -m end .mycluster2.ibm.net use_backend https-workers-03 if 03-https- Create a backend target for the above:
backend https-workers-03 mode tcp balance roundrobin server master1 192.168.3.11:443 check server master2 192.168.3.12:443 check server master3 192.168.3.13:443 check server worker1 192.168.3.51:443 check server worker2 192.168.3.52:443 check - Edit
We use this approach in OCP LibVirt CI see haproxy_C155F2U31.cfg
-
namedsupport multiple conf files using theincludedirective- Create the modular directory:
mkdir -p /etc/named/conf.d - Modify
/etc/named.confto include your custom zone files.include "/etc/named/conf.d/ocp-cluster-1.conf"; - Create the file
/etc/named/conf.d/ocp-cluster-1.conf
zone "mycluster2.ibm.net" IN { type master; file "/var/named/zones/db.ocp-cluster-1.local"; allow-query { any; }; }; zone "122.168.192.in-addr.arpa" IN { type master; file "/var/named/zones/ocp-cluster-1.192.168.122"; allow-query { any; }; }; - Create the modular directory:
Using this approach you’ll be able to share the bastion.
Leave a Reply