The system is now capable of being configured to use the wireless NIC wlan0 by user interaction. At this point however, there are manual steps which need to be done in order to restart the system such that the user can access the k3s cluster in the network they have configured.
We need to modify the host OS to expose the network. Ideally, we will be able to not only turn the reigns over to the user but also to revert the system to be reset for the base turnkey configuration. Both of these things can be accomplished by using the system upgrade controller. https://github.com/rancher/system-upgrade-controller
Turn the reigns over to the user
It is not yet clear what the best solution will be so here are a couple of options.
Option 1
The benefit of this solution may be it's simplicity
get the gateway default for wlan0
gwip=$(ip r | grep -e "default" | grep -e "wlan0" | awk '{print $3}')
add (or replace) the IP in /var/lib/rancher/turnkey/resolv.conf
echo "nameserver $gwip" >> /var/lib/rancher/turnkey/resolv.conf
delete the default route on eth0
ip r del default via 192.168.1.1 dev eth0
Option 2
The benefit of this solution is that it "gives back" the eth0 adapter if the end-user wants also use ethernet
write the wpa_supplicant.conf to the host
currently this is only available as a configmap in the cluster
from the wifi container
mount the host /etc/wpa_supplicant directory
cp the local wpa_supplicant to the host /etc/wpa_supplicant/wpa_supplicant.conf
and enable wpa_supplicant
this requires that wpa_supplicant is configured appropriately
systemctl enable wpa_supplicant
systemctl start wpa_supplicant
and restart k8s without pointing to the /var/lib/rancher/turnkey/resolv.conf
rm --resolv-conf flag from k3s or restart without it
cleanup the host /etc/rc.local file which bootstraps eth0
Reset the system
With the use of a systemd configuration file, it is possible to scan the /boot directory for a specific file and if it exists, take steps to reset.
The system is now capable of being configured to use the wireless NIC wlan0 by user interaction. At this point however, there are manual steps which need to be done in order to restart the system such that the user can access the k3s cluster in the network they have configured.
We need to modify the host OS to expose the network. Ideally, we will be able to not only turn the reigns over to the user but also to revert the system to be reset for the base turnkey configuration. Both of these things can be accomplished by using the system upgrade controller. https://github.com/rancher/system-upgrade-controller
Turn the reigns over to the user
It is not yet clear what the best solution will be so here are a couple of options.
Option 1
The benefit of this solution may be it's simplicity
gwip=$(ip r | grep -e "default" | grep -e "wlan0" | awk '{print $3}')
echo "nameserver $gwip" >> /var/lib/rancher/turnkey/resolv.conf
ip r del default via 192.168.1.1 dev eth0
Option 2
The benefit of this solution is that it "gives back" the eth0 adapter if the end-user wants also use ethernet
systemctl enable wpa_supplicant
systemctl start wpa_supplicant
Reset the system
With the use of a systemd configuration file, it is possible to scan the /boot directory for a specific file and if it exists, take steps to reset.