Pre-Load Content Deployment

5 min
Justin Barksdale
26 Jun 2023

What are we Trying to Achieve

Expanding on the work we did with previous testing, we are now in a position to test in more challenging environments. Imagine that some of our locations are challenged with reliable high-speed internet access. They have bandwidth constraints which would limit the amount of data we would want to pull down as it would take too long to deploy GBs worth of data.

With Palette Edge, we can pre-load content onto our ISO significantly reducing the required downloads. As an operations team, we have decided to test this in our lab.

Prerequisites

  • Internet Access
  • Palette Account
  • Command line tool to access the physical or virtual hardware via ssh
  • Kubectl
  • Physical or Virtual Hardware that can be “Flashed” with a new OS. (x86 Based)
  • DHCP is required for the physical or virtual edge device.
  • An additional available IP address on the same network as your DHCP scope.
  • Completion of Building Edge Native Artifacts

The provider images must have already been created and pushed to the registry prior to

This how-to guide was written with the following:

Jump Host Specs

  • 4-vCPU
  • 8GB Memory
  • 100GB Hard Disk

Software

This how-to guide was written with the following versions and hardware. These versions may differ slightly from what you are using.

Palette UI Build Host Build Host OS Docker Version GIT Version Palette CLI
v3.4.48 4-vCPU - 8GB Memory - 100GB Hard Disk Ubuntu 22.04.2 LTS 23.0.1 2.34.1 3.4.0

These steps should be done on the build host used to complete the Building Edge Native Artifacts

Download and Install the Palette Edge CLI

Currently the Palette Edge CLI is only available for AMD64 Unix based platforms.

  1. Download the Edge CLI for your OS type. Linux AMD64
curl https://software.spectrocloud.com/stylus/v3.4.3/cli/linux/palette-edge -o palette-edge
  1. Change the permissions to make it executable.
chmod 755 palette-edge
  1. Move the file to the bin directory.
mv palette-edge /bin/
  1. Verify the CLI is functional.
palette-edge show

SAMPLE OUTPUT

~ ./palette-edge show   
┌────────────────────────────────────────────────────────────────────────┐
| OS Flavor     | Description        | Base Image URI                    |
| opensuse-leap | Opensuse Leap 15.4 | quay.io/kairos/core-opensuse-leap |
| ubuntu-20     | Ubuntu 20.4 LTS    | quay.io/kairos/core-ubuntu-20-lts |
| ubuntu-22     | Ubuntu 22.4 LTS    | quay.io/kairos/core-ubuntu-22-lts |
└────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────────────────────────────────┐
| K8S Flavor | Description        | Supported Versions                                        |
| k3s        | Rancher K3s        | 1.25.2-k3s1,1.24.6-k3s1,1.23.12-k3s1,1.22.15-k3s1         |
| kubeadm    | Kubernetes kubeadm | 1.25.2,1.24.6,1.23.12,1.22.15                             |
| rke2       | Rancher RK2        | 1.25.2-rke2r1,1.24.6-rke2r1,1.23.12-rke2r1,1.22.15-rke2r1 |
└─────────────────────────────────────────────────────────────────────────────────────────────┘
┌─────────────────────────────────┐
| Component             | Version |
| Spectro Agent Version | v3.4.3  |
| Kairos Version        | v2.0.3  |
└─────────────────────────────────┘

Create an API Key

  1. Open a browser window and navigate to the Palette Console .

  2. Login to your organization . If you have not signed up you can sign up for a free trial Here .

  3. Navigate Tenant Settings on the left-hand menu (Bottom Left).

  • Select API Key
  • Click Add New API Key
  • Set API Key Name as something meaningful
  • Set the User Name as your username. (This is a username with the appropriate permissions in Palette)
  • Set the Expiration Date to a meaningful date

API Key

  1. Copy the Key to your clipboard.

Copy API Key

  1. Write the key to a variable.
API_KEY="aergas53t8asdfk"

Find Palette Cluster Profile ID

For the purposes of this tutorial we are using the cluster profile create in Create Cluster Profile

  1. Navigate to the Default project.

Default Project

  1. Select Profiles from the left-hand menu.
  2. Select the profile created in the Deploy Edge Native Cluster .
  3. The Profile ID is located in the address bar after profiles/cluster/.

Profile ID

  1. Copy the Profile ID and save it to a variable.
PROFILE_ID="645cf816b23162e5044c5cf6"

If you have multiple Profile IDs they can be added using a comma to separate each entry.

For reference, the values at the top of the pack are what define the content to be pre-loaded.

EXAMPLE

pack:
  content:
    images:
      - image: gcr.io/spectro-images-public/calico/cni:v3.25.0
      - image: gcr.io/spectro-images-public/calico/node:v3.25.0
      - image: gcr.io/spectro-images-public/calico/kube-controllers:v3.25.0
  1. The Project ID is also located in the address bar before profiles/cluster/.

Project ID

  1. Copy the Project ID and save it to a variable.
PROJECT_ID="63b5a2fa442d97a3fe94c62a"

Create an Offline Content Bundle

  1. Change directories into the CanvOS directory we created in Building Edge Native Artifacts .

  2. Run the following command to create the artifact.

palette-edge build --api-key $API_KEY \
 --project-id $PROJECT_ID \
 --cluster-profile-ids $PROFILE_ID \
 --palette-endpoint api.spectrocloud.com \
 --outfile content

If you followed the Building Edge Native Artifacts guide, your folder structure will look something like this.

ls -l                 
total 92
drwxr-xr-x 2 root root  4096 Jun 27 18:17 build
drwxr-x--- 2 jb   jb    4096 Jun 27 18:20 content-044c5cf6
-rw-rw-r-- 1 jb   jb     334 Jun 27 18:17 Dockerfile
-rw-rw-r-- 1 jb   jb    6443 Jun 27 18:17 Earthfile
-rwxrwxr-x 1 jb   jb    2479 Jun 27 17:40 earthly.sh
drwxrwxr-x 2 jb   jb    4096 Jun 11 11:29 images
-rw-rw-r-- 1 jb   jb   35203 Apr 25 11:33 LICENSE
drwxrwxr-x 4 jb   jb    4096 Apr 24 12:51 overlay
-rw-rw-r-- 1 jb   jb     289 Apr 25 11:26 OWNERS.md
-rw-rw-r-- 1 jb   jb   10716 Jun 27 17:40 README.md
-rw-rw-r-- 1 jb   jb     266 Jun 23 19:29 user-data
-rw-rw-r-- 1 jb   jb    2701 May  4 16:16 user-data.template
  • Notice the content-044c5cf6 folder has been created. Your folder name may vary.
  1. View the contents of that folder.
ls -l content-044c5cf6 
total 3981104
-rw-rw-r-- 1 jb jb 1598552722 Jun 27 18:20 app-content-044c5cf6.zst
-rw-rw-r-- 1 jb jb 2478086360 Jun 27 18:20 core-content-044c5cf6.zst

This folder contains the content for us to build our ISO. This content is only installed in the ISO and is not added to the provider images.

  1. Create the ISO.
./earthly +iso

Next Steps

  1. Continue with your deployment by completing this guide