SpectroCloud/AirGapEdgeISO: Difference between revisions
Jump to navigation
Jump to search
Line 97: | Line 97: | ||
#OLD export K8S_VERSION=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${CLUSTER_PROFILE_NAME}'")' | jq -r .spec.published.packs[1].tag` | #OLD export K8S_VERSION=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${CLUSTER_PROFILE_NAME}'")' | jq -r .spec.published.packs[1].tag` | ||
export CLUSTER_PROFILE_UID=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.spec.published.name=="'${CLUSTER_PROFILE_NAME}'") | select(.spec.published.profileVersion=="'${CLUSTER_PROFILE_VERSION}'")' | jq -r .spec.published.uid` | export CLUSTER_PROFILE_UID=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.spec.published.name=="'${CLUSTER_PROFILE_NAME}'") | select(.spec.published.profileVersion=="'${CLUSTER_PROFILE_VERSION}'")' | jq -r .spec.published.uid` | ||
export PROJECT_UID=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/projects' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${ | export PROJECT_UID=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/projects' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${PROJECT_NAME}'")' | jq -r .metadata.uid` | ||
export K8S_VERSION=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${CLUSTER_PROFILE_NAME}'") | select(.spec.published.profileVersion=="'${CLUSTER_PROFILE_VERSION}'")' | jq -r .spec.published.packs[1].tag` | export K8S_VERSION=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${CLUSTER_PROFILE_NAME}'") | select(.spec.published.profileVersion=="'${CLUSTER_PROFILE_VERSION}'")' | jq -r .spec.published.packs[1].tag` | ||
#echo $CLUSTER_PROFILE_UID; echo $PROJECT_UID; echo $K8S_VERSION; | #echo $CLUSTER_PROFILE_UID; echo $PROJECT_UID; echo $K8S_VERSION; |
Revision as of 16:50, 17 April 2025
Air-Gapped Edge ISO
Prerequisites
DER's Lab Specific
####################################### # Build the ISO on the JUMPBOX Server # ####################################### ssh [email protected] sudo su -
############################## # Mount the VMware Datastore # ############################## echo "172.16.84.7:/data/hdd/0-ISOs /nfs/0-ISOs nfs defaults 0 0" >> /etc/fstab cat /etc/fstab mkdir -p /nfs/0-ISOs systemctl daemon-reload mount -a
ISO Build Requirements
############################################## # Create Harbor Repo for the provider images # ############################################## # Name: airgap-edge # Type: public
################################################################# # Update the .args file and BYOI Layer with the Following Info: # ################################################################# # BYOI VALUES: options: system.uri: "{{ .spectro.pack.edge-native-byoi.options.system.registry }}/{{ .spectro.pack.edge-native-byoi.options.system.repo }}:{{ .spectro.pack.edge-native-byoi.options.system.k8sDistribution }}-{{.spectro.system.kubernetes.version }}-{{ .spectro.pack.edge-native-byoi.options.system.peVersion }}-{{ .spectro.pack.edge-native-byoi.options.system.customTag }}" system.registry: harbor.dersllc.com/airgap-edge system.repo: ubuntu system.k8sDistribution: kubeadm system.osName: ubuntu system.peVersion: v4.6.3 system.customTag: ders-edge system.osVersion: 22.04 # # .ARG FILE: # CUSTOM_TAG=ders-edge # IMAGE_REGISTRY=harbor.dersllc.com/airgap-edge # OS_DISTRIBUTION=ubuntu # IMAGE_REPO=$OS_DISTRIBUTION # OS_VERSION=22.04 # K8S_DISTRIBUTION=kubeadm # ISO_NAME=ders-edge-installer # ARCH=amd64 # UPDATE_KERNEL=false # CLUSTERCONFIG=test-edge-iso-profile-cluster-definition.tgz # CIS_HARDENING=true # BASE_IMAGE=quay.io/kairos/ubuntu:24.04-core-amd64-generic-v3.0.14
# CHANGE THE FOLLOWING IN THE K8S LAYER # REMOVE: AlwaysPullImages # MAKE SURE YOU HAVE THE HARBOR-EDGE-NATIVE-CONFIG LAYER ADDED TO THE PROFILE
Build the All-In-One ISO File
###################### # REQUIRED VARIABLES # ###################### export OS=ubuntu-fips; #rhel, rhel-fips, ubuntu, ubuntu-fips export PALETTE_ENDPOINT="paas.dersllc.com"; export API_KEY='Y2ZiYWZkNWRmN2E0YjAzYTFjYjYyOTBhMjk3YjZlMDg='; export CLUSTER_PROFILE_NAME="test-edge-iso-$OS" export CLUSTER_PROFILE_VERSION=1.0.2 export PROJECT_NAME="all-in-one-iso"; export EDGE_CLI_VERSION="v4.6.9"; #https://docs.spectrocloud.com/component/#palette-edge-cli-versions ################################# # Download the Palette-Edge CLI # ################################# wget https://software.spectrocloud.com/stylus/$EDGE_CLI_VERSION/cli/linux/palette-edge chmod +x palette-edge mv palette-edge /usr/local/bin cd ~; rm -rf CanvOS ################################### # Use GIT to pull the CanvOS Repo # ################################### git clone https://github.com/spectrocloud/CanvOS.git cd CanvOS #export EDGE_CLI_VERSION=`git tag | sort --version-sort | tail -1` git checkout $EDGE_CLI_VERSION ################################################ # Pull the .arg and user-data file from gitlab # ################################################ curl https://ders-gitlab.dersllc.com/ders/spectro-sa/-/raw/main/airgapped-edge/.arg-$OS.yaml > .arg curl https://ders-gitlab.dersllc.com/ders/spectro-sa/-/raw/main/airgapped-edge/user-data-$OS.yaml > user-data #sudo ./earthly.sh +validate-user-data ############################################################################### # Get the Project and Cluster Profile IDs and K8S Version from the VERTEX API # ############################################################################### #OLD: export CLUSTER_PROFILE_UID=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${CLUSTER_PROFILE_NAME}'")' | jq -r .metadata.uid` #OLD export K8S_VERSION=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${CLUSTER_PROFILE_NAME}'")' | jq -r .spec.published.packs[1].tag` export CLUSTER_PROFILE_UID=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.spec.published.name=="'${CLUSTER_PROFILE_NAME}'") | select(.spec.published.profileVersion=="'${CLUSTER_PROFILE_VERSION}'")' | jq -r .spec.published.uid` export PROJECT_UID=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/projects' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${PROJECT_NAME}'")' | jq -r .metadata.uid` export K8S_VERSION=`curl -L 'https://'${PALETTE_ENDPOINT}'/v1/clusterprofiles' -H 'Accept: application/json' -H 'ApiKey: '$API_KEY | jq '.items[] | select(.metadata.name=="'${CLUSTER_PROFILE_NAME}'") | select(.spec.published.profileVersion=="'${CLUSTER_PROFILE_VERSION}'")' | jq -r .spec.published.packs[1].tag` #echo $CLUSTER_PROFILE_UID; echo $PROJECT_UID; echo $K8S_VERSION; ##################################### # Pull Variables from the .arg File # ##################################### export CUSTOM_TAG=`cat .arg | grep CUSTOM_TAG | cut -d "=" -f 2` export IMAGE_REGISTRY=`cat .arg | grep IMAGE_REGISTRY | cut -d "=" -f 2` export OS_DISTRIBUTION=`cat .arg | grep OS_DISTRIBUTION | cut -d "=" -f 2` export OS_VERSION=`cat .arg | grep OS_VERSION | cut -d "=" -f 2` export K8S_DISTRIBUTION=`cat .arg | grep K8S_DISTRIBUTION | cut -d "=" -f 2` export ISO_NAME=`cat .arg | grep ISO_NAME | cut -d "=" -f 2` #echo $CUSTOM_TAG; echo $IMAGE_REGISTRY; echo $OS_DISTRIBUTION; echo $OS_VERSION; echo $K8S_DISTRIBUTION; echo $ISO_NAME echo '{"'$K8S_DISTRIBUTION'":["'$K8S_VERSION'"]}' | jq > k8s_version.json; # Set only the version you need in the k8s_version.json. This needs to match the version in your profile. #cat k8s_version.json ######################################### # Customize the Local-Ui (Not-Required) # ######################################### mkdir -p local-ui/ui mkdir -p local-ui/app curl https://ders-gitlab.dersllc.com/ders/spectro-sa/-/raw/main/airgapped-edge/customizations/customizations.json > local-ui/ui/customizations.json curl https://ders-gitlab.dersllc.com/ders/spectro-sa/-/raw/main/airgapped-edge/customizations/index.html > local-ui/app/index.html curl https://ders-gitlab.dersllc.com/ders/spectro-sa/-/raw/main/airgapped-edge/customizations/154x65.png > local-ui/ui/154x65.png tar cvf local-ui.tar local-ui ############################# # Build the Provider Images # ############################# #sudo ./earthly.sh +build-provider-images sudo ./earthly.sh +build-provider-images-fips
############################################# # Push the Provider image to the Image Repo # ############################################# docker push $IMAGE_REGISTRY/$OS_DISTRIBUTION:$K8S_DISTRIBUTION-$K8S_VERSION-$EDGE_CLI_VERSION-$CUSTOM_TAG ########################################################### # Export the Vertex Profile Definition and Content Bundle # ########################################################### palette-edge build --api-key $API_KEY \ --project-id $PROJECT_UID \ --cluster-profile-ids $CLUSTER_PROFILE_UID \ --palette-endpoint $PALETTE_ENDPOINT \ --outfile $CLUSTER_PROFILE_NAME-content-bundle \ --include-palette-content \ --cluster-definition-name $CLUSTER_PROFILE_NAME-cluster-definition \ --cluster-definition-profile-ids $CLUSTER_PROFILE_UID
############################ # Build the All-In-One ISO # ############################ sudo ./earthly.sh +iso ####################################### # Move the ISO to my VMware Datastore # ####################################### touch ~/CanvOS/build/$ISO_NAME.iso mv ~/CanvOS/build/$ISO_NAME.iso /nfs/0-ISOs/
References
Building Provider Images
https://docs.spectrocloud.com/clusters/edge/edgeforge-workflow/palette-canvos/build-provider-images/
Build Content Bundle
https://docs.spectrocloud.com/clusters/edge/edgeforge-workflow/palette-canvos/build-content-bundle/
Create Installer ISO
https://docs.spectrocloud.com/clusters/edge/edgeforge-workflow/palette-canvos/build-installer-iso/
Local-UI Custom Branding
https://docs.spectrocloud.com/clusters/edge/local-ui/host-management/theming/
Local-UI Custom Links
https://docs.spectrocloud.com/clusters/edge/local-ui/host-management/custom-link/