|
| 1 | +--- |
| 2 | +sidebar_label: "Build Content Bundle" |
| 3 | +title: "Build Content Bundle" |
| 4 | +description: |
| 5 | + "Get started with Kubernetes at the edge. Learn how to build the artifacts required for your locally managed Edge |
| 6 | + deployment." |
| 7 | +icon: "" |
| 8 | +hide_table_of_contents: false |
| 9 | +sidebar_position: 60 |
| 10 | +tags: ["getting-started", "tutorial", "locally-managed", "airgap", "edge"] |
| 11 | +--- |
| 12 | + |
| 13 | +[Cluster profiles](../../../../profiles/profiles.md) are declarative, full-stack models that Palette uses to provision, |
| 14 | +scale, and maintain Kubernetes clusters. They are composed of layers, which can be Kubernetes manifests, Helm charts, or |
| 15 | +packs. [Packs](../../../../registries-and-packs/registries-and-packs.md) are a collection of files and configurations |
| 16 | +deployed to a cluster to provide core infrastructure functionality or customize the cluster's behavior through add-on |
| 17 | +integrations. |
| 18 | + |
| 19 | +This tutorial teaches you how to create an Edge native cluster profile that includes the core infrastructure layers and |
| 20 | +a demo application that you can access on your browser. You will learn about cluster profile layers and how to reference |
| 21 | +the provider images that you built in the [Build Edge Artifacts](./build-edge-artifacts.md) tutorial. After creating the |
| 22 | +cluster profile, you will proceed to the next tutorial, where you will use the installer ISO to bootstrap the Edge |
| 23 | +installation on your host and use it as a node for deploying your first Edge cluster. |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | +## Prerequisites |
| 28 | + |
| 29 | +- You have completed the steps in the [Build Edge Artifacts](./build-edge-artifacts.md) tutorial, including building the |
| 30 | + installer ISO and provider image, and pushing the provider image to a registry. |
| 31 | +- A [Palette account](https://www.spectrocloud.com/get-started) with |
| 32 | + [tenant admin](../../../../tenant-settings/tenant-settings.md) access. |
| 33 | +- One available IP address on the same network as the Edge host for the MetalLB load balancer. |
| 34 | + |
| 35 | +### Export and Download Cluster Profile |
| 36 | + |
| 37 | +With the cluster profile created, you will need to export it as a compressed `.tgz` file. You will need to download the |
| 38 | +[Palette Edge CLI](../../../../downloads/cli-tools.md#palette-edge-cli) to your Linux machine. |
| 39 | + |
| 40 | +<!-- vale off --> |
| 41 | + |
| 42 | +```shell |
| 43 | +VERSION=<palette-edge-cli-version> |
| 44 | +wget https://software.spectrocloud.com/stylus/v$VERSION/cli/linux/palette-edge |
| 45 | +chmod +x palette-edge |
| 46 | +``` |
| 47 | + |
| 48 | +<Tabs groupId="cli-options"> |
| 49 | + |
| 50 | +<TabItem label="Palette CLI" value="Palette CLI"> |
| 51 | + |
| 52 | +You will use the Palette Edge CLI tool to authenticate against Palette, and download a specific cluster profile from a |
| 53 | +specific project. You will need the following values: |
| 54 | + |
| 55 | +- [API Key](../../../../user-management/authentication/api-key/create-api-key.md) |
| 56 | +- [Project ID](../../../../tenant-settings/projects/projects.md#project-id) |
| 57 | +- [Cluster Profile ID](../../../../clusters/edge/local-ui/cluster-management/export-cluster-definition.md#enablement-1) |
| 58 | + |
| 59 | +Use the following Palette Edge ClI to generate the cluster profile compressed `.tgz` file. |
| 60 | + |
| 61 | +```shell |
| 62 | +./palette-edge build --api-key <apikey> --project-id <project-id> \ |
| 63 | +--cluster-profile-ids <profile-id> --cluster-definition-profile-ids <profile-id> \ |
| 64 | +--palette-endpoint <https://api.yourpalette> --cluster-definition-name <cluster-profile-name> \ |
| 65 | +--outfile <cluster-profile-name.tgz> --include-palette-content |
| 66 | +``` |
| 67 | + |
| 68 | +<!-- vale on --> |
| 69 | + |
| 70 | +Alternatively, you can use the script below to prompt you when doing the Palette Edge CLI command. The API key will |
| 71 | +appear blank for security reasons. |
| 72 | + |
| 73 | +<!-- vale off --> |
| 74 | +```shell |
| 75 | +#!/usr/bin/env bash |
| 76 | +set -euo pipefail |
| 77 | + |
| 78 | +# --- Inputs --- |
| 79 | +read -rsp "Enter Palette API key: " apikey |
| 80 | +echo |
| 81 | +read -rp "Enter Palette Project UID: " projectuid |
| 82 | +read -rp "Enter Cluster Profile UID(s) (comma-separated if multiple): " profileuids |
| 83 | +read -rp "Palette console URL [https://console.spectrocloud.com]: " console_url |
| 84 | +read -rp "Enter custom tag (used for naming): " custom_tag |
| 85 | +read -rsp "Enter Palette CLI encryption passphrase: " enc_pass |
| 86 | +echo |
| 87 | + |
| 88 | +# Default console URL |
| 89 | +console_url=${console_url:-https://console.spectrocloud.com} |
| 90 | + |
| 91 | +bundle_name="${custom_tag}-content-bundle" |
| 92 | +definition_name="${custom_tag}-cluster-definition" |
| 93 | + |
| 94 | +echo |
| 95 | +echo "Logging into Palette CLI..." |
| 96 | +palette login \ |
| 97 | + --api-key "${apikey}" \ |
| 98 | + --console-url "${console_url}" \ |
| 99 | + --encryption-passphrase "${enc_pass}" |
| 100 | + |
| 101 | +echo |
| 102 | +echo "Building content bundle..." |
| 103 | +echo " Cluster definition: ${definition_name}" |
| 104 | +echo " Bundle name: ${bundle_name}" |
| 105 | +echo |
| 106 | + |
| 107 | +palette content build \ |
| 108 | + --arch amd64 \ |
| 109 | + --project-id "${projectuid}" \ |
| 110 | + --profiles "${profileuids}" \ |
| 111 | + --cluster-definition-name "${definition_name}" \ |
| 112 | + --cluster-definition-profile-ids "${profileuids}" \ |
| 113 | + --name "${bundle_name}" \ |
| 114 | + --include-core-palette-images-only \ |
| 115 | + --progress |
| 116 | + |
| 117 | +bundle_path="./output/content-bundle/${bundle_name}.tar.zst" |
| 118 | + |
| 119 | +echo |
| 120 | +echo "Done ✅" |
| 121 | +echo |
| 122 | +echo "Content bundle created:" |
| 123 | +echo " ${bundle_path}" |
| 124 | +echo |
| 125 | +echo "Transfer this file to the airgapped Edge device and upload it via:" |
| 126 | +echo " - Local UI" |
| 127 | +echo " - or: palette content upload (from a reachable system)" |
| 128 | +echo |
| 129 | +``` |
| 130 | +<!-- vale on --> |
| 131 | + |
| 132 | +</TabItem> |
| 133 | + |
| 134 | +<TabItem label="Palette Edge CLI" value="Palette Edge CLI"> |
| 135 | +Alternatively, you can use the script below to prompt you when doing the Palette Edge CLI command. The API key will |
| 136 | +appear blank for security reasons. |
| 137 | + |
| 138 | +<!-- vale off --> |
| 139 | +```shell |
| 140 | +#!/usr/bin/env bash |
| 141 | + |
| 142 | +set -euo pipefail |
| 143 | + |
| 144 | +# Prompt for variables |
| 145 | +read -rsp "Enter API key: " apikey #hide the API when entered in |
| 146 | +echo |
| 147 | +read -rp "Enter Project UID: " projectuid |
| 148 | +read -rp "Enter Profile UID: " profileuid |
| 149 | +read -rp "Palette API endpoint [https://api.spectrocloud.com]: " apiendpoint |
| 150 | +read -rp "Enter custom tag (used for naming): " custom_tag |
| 151 | + |
| 152 | +# Default endpoint if empty |
| 153 | +apiendpoint=${apiendpoint:-https://api.spectrocloud.com} |
| 154 | + |
| 155 | +echo |
| 156 | +echo "Building content bundle..." |
| 157 | +echo " Cluster definition: ${custom_tag}-cluster-definition" |
| 158 | +echo " Output file: ${custom_tag}-content-bundle" |
| 159 | +echo |
| 160 | + |
| 161 | +./palette-edge build \ |
| 162 | + --api-key "$apikey" \ |
| 163 | + --project-id "$projectuid" \ |
| 164 | + --cluster-profile-ids "$profileuid" \ |
| 165 | + --cluster-definition-profile-ids "$profileuid" \ |
| 166 | + --palette-endpoint "$apiendpoint" \ |
| 167 | + --cluster-definition-name "${custom_tag}-cluster-definition" \ |
| 168 | + --outfile "${custom_tag}-content-bundle" \ |
| 169 | + --include-palette-content |
| 170 | + |
| 171 | +echo |
| 172 | +echo "Done ✅" |
| 173 | +``` |
| 174 | +<!-- vale on --> |
| 175 | + |
| 176 | +</TabItem> |
| 177 | + |
| 178 | +</Tabs> |
| 179 | + |
| 180 | +The `.tgz` file will need to be uploaded to the locally managed Edge device after it is built using the Edge UI. If you |
| 181 | +are using a browser on a system other than your Linux system to access the Edge UI, you will need to download the `.tgz` |
| 182 | +file. |
| 183 | + |
| 184 | +```shell |
| 185 | + |
| 186 | +scp <username>@<ip-of-linux-system>:/path/to/<filename>.tgz . |
| 187 | + |
| 188 | +``` |
| 189 | + |
| 190 | +## Next Steps |
| 191 | + |
| 192 | +In this tutorial, you learned how to install the Palette agent on your host and register the host with Palette. We |
| 193 | +recommend proceeding to the [Deploy Cluster](./deploy-edge-cluster.md) tutorial to learn how to build the cluster |
| 194 | +content bundle to use on the locally managed Edge device. |
0 commit comments