I found the Raspberry Pi Imager - Utility to work best. The first revision of the project will boot the initial kernel from MicroSD card and then pivot to the MSD device.
1. Use the Ubuntu 20.04 64bit version for both the MicroSD and the MSD device.
2. After writing the MicroSD card - mount the /boot partition of that card and modify the /boot/cmdline.txt file to:
net.ifnames=0 console=serial0,115200 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 swapaccount=1
Note that I removed the USB-OTG statement. Not gonna need that.
3. It is helpful to remove or re-label the second partition on the MicroSD card - to prevent booting root there. You really want to use the MSD device for all the things.
2Boot the first node.
Building a cluster a node at a time in the initial stages is a good thing. Once you have a quorum in the control plane - and HA, adding nodes is less risky.
Start with stabilizing the seed node. Run the installation -
sudo snap install microk8s --classic --channel=1.19/stable
Then follow https://microk8s.io/docs/clustering
My nodes have been up for awhile.
ubuntu@Stan:~$ microk8s kubectl get nodes NAME STATUS ROLES AGE VERSION stan Ready <none> 8d v1.19.0-34+ff9309c628eb68 kenny Ready <none> 5d v1.19.0-34+ff9309c628eb68 kyle Ready <none> 8d v1.19.0-34+ff9309c628eb68 cartman Ready <none> 8d v1.19.0-34+ff9309c628eb68 butters Ready <none> 4d21h v1.19.0-34+ff9309c628eb68 ubuntu@Stan:~$
3Enable DNS and add some tools
Enable DNS. Note that if you have all three nodes up, they will all have DNS enabled.
microk8s enable dns
The first three nodes are the core minimal requirement for HA. This provides a voting logic quorum to ensure there is at least one sane node.
You may want to monitor CPU temp.
sudo apt install lm-sensors The command to get CPU temp is "sensors" ubuntu@ike:~$ sensors cpu_thermal-virtual-0 Adapter: Virtual device temp1: +54.0°C rpi_volt-isa-0000 Adapter: ISA adapter in0: N/A ubuntu@ike:~$
A great tool for using with your cluster is K9s. Install on at least one of your cluster nodes. I install on all the nodes - because I can run this on a console!
You will need to create a ~/.kube/config file for K9s to use to interact with your cluster. There should already be a ~/.kube directory. Check the permissions on this directory - they may need to be changed from root/root to ubuntu/ubuntu.
cd $HOME mkdir .kube cd .kube microk8s config > config
tar xfz k9s_Linux_arm64.tar.gz
The interface is helpful to those who are new to Kubernetes and useful for experienced cluster drivers.
4Installing EFK stack on Ubuntu 20.10 arm64 / Pi 4/4G
Download the arm64/aarch64 version of Elasticsearch and Kibana. A requirement of the stack is the two components ( elasticsearch and kibana ) should have identical levels to be optimal. Kibana startup checks will fail if the version difference is too great.
I have selected version 7.9.3
wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-7.9.3-arm64.deb wget https://artifacts.elastic.co/downloads/kibana/kibana-7.9.3-linux-aarch64.tar.gz
sudo dpkg -i elasticsearch-7.9.3-arm64.deb
I modified a couple of the elasticsearch config files -
cluster.name: SodoSopa node.name: ike network.host: 192.168.1.44 http.port: 9200 cluster.initial_master_nodes: ["ike"]
# Xms represents the initial size of total heap space # Xmx represents the maximum size of total heap space -Xms2g -Xmx2g
Start Elasticsearch and test the endpoint.
sudo /bin/systemctl daemon-reload sudo /bin/systemctl enable elasticsearch.service sudo systemctl start elasticsearch.service sudo systemctl status elasticsearch.service curl -X GET "localhost:9200/?pretty"
Unzip and untar the kibana distribution
tar xfz kibana-7.9.3-linux-aarch64.tar.gz
If you want to access Kibana from an external host ( not localhost ) then edit the kibana config file and set these variables to match your install.
server.host: "192.168.1.44" server.name: "ike" elasticsearch.preserveHost: true
While in the kibana-7.9.3-linux-aarch64 directory, run the following to start Kibana in the foreground - this way you can observe the startup messages to address any configuration issues.
Point a web browser to the server address and port 5601 ( default port configuration )
This should bring up the Kibana interface.