Make sure that we use an IP address for the microk8s join commands. This is done by filtering for addresses of type InternalIP or ExternalIP.
Changes
Update getControlPlaneNodesToJoin to group the list of control plane addresses by type, then return a list of addresses of the same type. The order of preference is defined as InternalIP, then ExternalIP. We return the first list of addresses that is not empty.
Do not use a [2]string for the join addresses, but rather return the full slice of found addresses.
Adjust the 20-microk8s-join.sh script to accept any number of join urls, not hardcoded to two.
If no node IPs are found, we print an error and list the addresses that we found (hopefully this should be clear enough in case no IP is set on the machine addresses).
Summary
Make sure that we use an IP address for the microk8s join commands. This is done by filtering for addresses of type
InternalIP
orExternalIP
.Changes
getControlPlaneNodesToJoin
to group the list of control plane addresses by type, then return a list of addresses of the same type. The order of preference is defined asInternalIP
, thenExternalIP
. We return the first list of addresses that is not empty.[2]string
for the join addresses, but rather return the full slice of found addresses.20-microk8s-join.sh
script to accept any number of join urls, not hardcoded to two.