K3s installation#

K3s is a lightweight version of Kubernetes (K8s) that reduces the number of dependencies and requirements needed to install a K8s cluster. Upon request, Anaconda can provide you with the necessary assets to install Data Science & AI Workbench on K3s. After verifying that your environment is prepared for installation using the following pre-installation checklist, you are ready to install the cluster!

Pre-installation#

Perform all actions from an administrative account that has sudo access on all nodes and a non-zero UID:

  1. SSH onto the primary node.

  2. Deliver the latest Workbench image tarball and K3s bundle to the primary node.

  3. Unpack the K3s bundle and cd into the directory that it creates.

  4. Remove old installations of conda by running the following command:

    rm -rf ~/ae5-conda ~/miniconda3
    
  5. Install and activate the ae5_conda environment by running the following commands:

    bash ae5-conda-latest-Linux-x86_64.sh
    source ~/ae5-conda/bin/activate
    
  6. Stage the K3s assets by running the following command:

    ./k3s_preinstall.sh
    

    Caution

    • By default, the pre-install script uses the hostname stored in the HOSTNAME environment variable to populate the k3s_values.yaml file. To use a different hostname, edit that file or include the --hostname <HOSTNAME> argument in your pre-install script command.

    • If you are performing a single-node install, supply the --single-node argument in the pre-install script command to skip instructions for adding nodes and use the anaconda-storage volume for managed persistence.

    The k3s_preinstall.sh script produces two files: k3s_values.yaml and NEXT_STEPS.txt.

    The pre-installation script is designed to coach you on the necessary actions you need to take to install if your system is not ready. For example, if you do not have your instance backed up, the k3s_preinstall.sh script will inform you that the backups are missing and tell you to perform a backup before proceeding. Once the script has completed, it saves the output to the NEXT_STEPS.txt file.

    • If you have made an error during the pre-installation process, perform the pre-installation cleanup commands. and start over.

    • It is safe to run the ./k3s_preinstall.sh command as many times as is necessary. No destructive actions are performed on your cluster by running the pre-install script.

  7. Verify that both of the files produced by running the pre-installation script were successfully generated. If you cannot find the files, stop here and consult your Workbench support team to diagnose the failures and complete pre-installation successfully.

Installation#

The following steps detail the conventional output of what the k3s_preinstall.sh script instructs you to do. However, the script makes adjustments to these steps based on your local environment and outputs them to the NEXT_STEPS.txt file. Review the file and, if the output diverges from these instructions, follow the instructions in the file instead.

  1. Log out of the server node, then log back in to pick up the environment changes that were made during the pre-installation process.

  2. Navigate to the anaconda-enterprise-k3s-* directory and install K3s by running the following command:

    ./k3s_install.sh
    

    Note

    This script installs and starts K3s, then uploads the Workbench images. The image upload process can take up to 30 minutes to complete, depending on your setup.

  3. Once the image uploads begin, you can continue with installation by opening a second terminal and navigating back to the anaconda-enterprise-k3s-* directory, or you can wait until the images are fully uploaded to continue.

  4. If your cluster has multiple nodes, add them now by running the following command for each node:

    # Replace <PRIVATE_IP> with the nodes private network IP address
    ./k3s_addnode.sh <PRIVATE_IP>
    
  5. Verify that the k3s_values.yaml contains the expected Workbench configuration values.

    Tip

    Take your time and verify everything is correct!

  6. Once the Workbench images are fully loaded, install the Workbench application by running the following command:

    helm install -f k3s_values.yaml anaconda-enterprise Anaconda-Enterprise/
    
  7. Monitor your cluster’s resources while they stabilize to ensure there are no unexpected issues by running the following command:

    watch kubectl get pods
    

    Allow time for the pods to appear and move to the Ready and Running states.

  8. Open a browser and navigate to your instance of Workbench.

  9. Log in to Workbench and explore the platform!