This is the third in the continued effort to turn six Odroid-MC1 Solos into a PXE booted computer cluster on which to engage in further FOSS hijinks. Previous post covered the steps involved in setting up the MicroSD cards to PXE boot the cluster nodes and mount root file system over NFS.
In this post, the plan is to install to convert the nodes from using NetworkManager to using Systemd-Networkd, install latest versions of Saltstack and using Salt push docker installs to all the cluster nodes.
Overview
The Salt master machine already has Salt installed, and is where all state files will be created and pushed from. Initial install of the Salt minion software will take place on each of the cluster nodes. Once each minion is installed and communication with the master all subsequent changes will be pushed from the Salt master.
Assumptions (Will need to be modified to the specifics of your environment)
DNS allows Salt master to be looked up as salt
IP address of Salt master is 192.168.1.96
Salt minion ids for each of the cluster nodes are MC1_0, MC1_1, MC1_2,…, MC1_5
Salt minion IP addresses are in the range 192.168.1.180-192.168.1.185
Installing Saltstack Minion Software
Salt-Minions on Ubuntu Armhf Devices
Much of the information and steps involved below were drawn from a previous post Notes on Upgrading Salt. As of the time of this writing the Ubuntu repository offers an older version of Salt and is still based on Python 2.7 which went out of support January 2020. As a result we will be bootstrapping and building Salt on each of the cluster nodes as below:
On minion MC1_0 via ssh, remove existing salt minion with sudo apt remove salt-minion salt-common -y
On minion, make bootstrap directory, sudo mkdir -p /opt/projects/salt
Change to working directory, cd /opt/projects/salt
Get bootstrap script with sudo curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
Bootstrap to desired version with sudo sh bootstrap-salt.sh -r -x python3 -P git v2019.2
Unmask service with sudo systemctl unmask salt-minion
Enable service with sudo systemctl enable salt-minion
On master remove old minion key with sudo salt-key -d mc1_0
On minion start service with sudo systemctl start salt-minion
On master accept minion key with sudo salt-key -a mc1_0
On minion restart service with sudo systemctl restart salt-minion
Repeat the steps above for each of the other 5 minions, MC1_1 to MC1_5.
Testing Salt Connectivity
After completing all the work, it’s important to test connectivity and make sure all the minions are running the same level of code.
Change from NetworkManager to Systemd-Networkd Using Salt
The Hardkernel provided minimal Ubuntu image I am using on the MC1 cluster nodes uses NetworkManager to provide network connectivity and I prefer to rely on systemd-networkd. From the list of active services below, I would like to get rid of NetworkManager.service, ModemManager.service and wpa_supplicant.service, and instead use systemd-networkd. wpa_supplicant.service while not strictly a NetworkManager service, does not need to be running unless it is being used to prove wireless connectivity. Since none of the cluster nodes are using wireless, there is no need for the service to be running, and so we will uninstall wpa_supplicant and NetworkManager entirely once we have systemd-networkd installed and working as desired.
Services Before Change
Stop and Mask NetworkManager
sudo systemctl stop NetworkManager
sudo systemctl disable NetworkManager
sudo systemctl mask NetworkManager
Enable and Start systemd-networkd
sudo systemctl unmask systemd-networkd.service
sudo systemctl enable systemd-networkd.service
sudo systemctl start systemd-networkd.service
Set Network Configuration with Netplan
Create /etc/netplan/config.yaml with content as below, changing ip address as appropriate for each node.
Run sudo netplan apply to apply changes
Reboot the node to make sure it works.
Uninstall Software
If node comes up properly after reboot, it is safe to remove unnecessary software.
Run sudo apt remove wpasupplicant network-manager modemmanager
Run sudo apt autoremove
After Systemd-Networkd Switchover Completes
This is what things look like after the above, three previously running services are gone, and one new service is running, systemd-networkd.service.
Installing Docker Community Edition Using Salt
The Ubuntu repository has a version of Docker which does not appear to work, or at least fails to install properly. As a result I wound up having to install Docker from the official repository, and even then the latest version failed to install, so I wound up going with an older version to at least get things running. If I manager to shift to the latest version, I will provide an updated post.
Install Dependencies
Run sudo apt-get install apt-transport-https ca-certificates curl software-properties-common on each MC1 node. I will use Salt for this to do the installs across all nodes ate the same time.
Add Docket GPG key by running curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -, Salt again.
Add Docker repository by running sudo add-apt-repository "deb [arch=armhf] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" on each node.
Install specific version of docker using sudo apt-get install docker-ce=5:18.09.9~3-0~ubuntu-bionic docker-ce-cli=5:18.09.9~3-0~ubuntu-bionic on each node then hold the version so it does not get automatically upgraded.
Test that docker works using sudo docker run hello-world on each node.
Next Steps
Set up docker swarm and test functionality
Setup backups
Build state files to handle all the configuration via Salt
However enough for this post.
Chrls is currently a technology transformation leader at one of the oldest American investment banking services holding companies, headquartered in New York City. Previous roles at current employer include project manager, front office support, retail and enterprise global Windows server support. Currently residing in Tennessee on the Cumberland Plateau and enjoying life, family and open source.