Setting Up a Multi-Node Cluster

Setting Up a Multi-Node Cluster

The following steps describe how to automatically set up and configure a multi-node Kubernetes cluster for
Resonate RFID Reader Management
installation. You should perform the steps as
root
or a user with
sudo
privileges.
These steps use the
setup.sh
script. To manually perform the setup tasks that the
setup.sh
script performs, refer to Manually Setting Up a Resonate Kubernetes Cluster. The
setup.sh
script is recommended for production deployments because it is efficient and reduces the likelihood of errors. Use the manual process only for educational purposes or when you need to understand each step in detail. Both the automated script and the manual process require internet access.
It is typical for
setup.sh
to request that you reboot the system to apply updates. After the reboot, you must run
setup.sh
again, with the exact same options, to continue and complete the setup. If the setup fails during a wait for the system to be ready, it might be due to network speed. Rerun the
setup.sh
script using the same settings to continue with the setup process.
  1. Ensure that all systems intended for the cluster meet the prerequisites for a multi-node configuration, especially ensuring that their K8s ports permit access to and from the other nodes in the cluster. Refer to Preparing for Installation.
  2. On all the systems, extract the files from the appropriate tar file:
    • For the online installer:
      tar xvf trifecta-installer-k8s-<VERSION>.<BUILD NUMBER>.tar.gz
    • For the offline installer:
      tar xvf trifecta-installer-k8s-<VERSION>.<BUILD NUMBER>-offline.tar.gz
    This extracts
    setup.sh
    ,
    trifecta.tar
    , and
    lb.yml
    . From the offline tar file, this also extracts the
    base-images.tar
    file.
  3. Primary Node - Initial Setup
  4. On the primary node, run the following command:
    sudo -E ./setup.sh -m <N> -b <DEVICE> [-i <IP>]
    Replace
    <N>
    with the number of nodes intended for the cluster and
    <DEVICE>
    with the path of the block device for storage. If you do not have a load balancer (bare metal), use the -i option and replace
    <IP>
    with a unique external IP address to use for the cluster, on the same subnet as the nodes, and with a DNS record; this enables the
    metalLB
    load balancer. For example, to set up a 3-node cluster with free storage on /dv/nvme1n1 and without a preexisting load balancer, using 10.10.10.13 as the IP of the
    metalLB
    load balancer, the command would be:
    sudo -E ./setup.sh -m 3 -b /dev/nvme1n1 -i 10.10.10.13
    For additional information and options, refer to setup.sh.
    This command ensures that the system meets prerequisites, it creates the user
    trif-user
    , and it extracts the installation files (including
    install.sh
    ) from
    trifecta.tar
    into the
    trif-user
    's home directory (/opt/zebra/trifecta). It displays a success message when it completes successfully.
  5. Secondary Nodes - Setup
  6. On each secondary node, run the following command:
    sudo -E ./setup.sh --microk8s-only
    This installs only microk8s on the system.
  7. On the primary node, run the following command as many times as there are secondary nodes:
    sudo -E /snap/bin/microk8s add-node
    This command returns a token command to run on one of the secondary nodes. You cannot reuse this token command on all secondary nodes; each node requires a unique one. Take note of the token command that each call returns.
  8. On each of the secondary nodes, run a different token command from the previous step (obtained from the primary node). It should look similar to the following:
    sudo -E /snap/bin/microk8s join <IP OR HOSTNAME>:25000/<TOKEN>
    There is no need to wait for a node to join the cluster before adding the next node. You can add them in parallel.
  9. On each secondary node, after it joins the cluster, run the following command to set up its storage:
    sudo -E ./setup.sh --storage-only -b <DEVICE>
    Replace <DEVICE> with the path of the block device of the secondary node. This generally resembles
    /dev/
    which might be
    /dev/sdb
    ,
    /dev/nvme1n1
    , or something similar.
  10. On the primary node, run the following command to finalize the setup of the cluster:
    sudo -E ./setup.sh --finalize
After finalizing the setup of the cluster, install
Resonate RFID Reader Management
. Refer to Installing Resonate RFID Reader Management.
For future upgrades, save the setup command that you ran on the primary node, including all settings; you will need to specify the exact same settings when upgrading. Although the command should be retrievable from your command history (
history | grep setup.sh
), it is good to save it separately as a backup.