From 398518b0a9876108e423ceb045648aa3eda3b2cc Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Thu, 4 Jul 2024 10:06:42 -0400 Subject: [PATCH 1/9] chore: disable CIS hardening by default; sort distros Signed-off-by: Tyler Gillson --- Earthfile | 74 +++++++++++++++++++++++++++---------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/Earthfile b/Earthfile index 3e29606..0d1457c 100644 --- a/Earthfile +++ b/Earthfile @@ -36,7 +36,7 @@ ARG CLUSTERCONFIG ARG EDGE_CUSTOM_CONFIG=.edge-custom-config.yaml ARG ARCH ARG DISABLE_SELINUX=true -ARG CIS_HARDENING=true +ARG CIS_HARDENING=false ARG UBUNTU_PRO_KEY ARG FIPS_ENABLED=false @@ -136,61 +136,61 @@ build-provider-images: IF [ "$K8S_DISTRIBUTION" = "kubeadm" ] BUILD +$TARGET --K8S_VERSION=1.24.6 BUILD +$TARGET --K8S_VERSION=1.25.2 - BUILD +$TARGET --K8S_VERSION=1.26.4 - BUILD +$TARGET --K8S_VERSION=1.27.2 BUILD +$TARGET --K8S_VERSION=1.25.13 + BUILD +$TARGET --K8S_VERSION=1.25.15 + BUILD +$TARGET --K8S_VERSION=1.26.4 BUILD +$TARGET --K8S_VERSION=1.26.8 + BUILD +$TARGET --K8S_VERSION=1.26.10 + BUILD +$TARGET --K8S_VERSION=1.26.12 + BUILD +$TARGET --K8S_VERSION=1.26.15 + BUILD +$TARGET --K8S_VERSION=1.27.2 BUILD +$TARGET --K8S_VERSION=1.27.5 BUILD +$TARGET --K8S_VERSION=1.27.7 - BUILD +$TARGET --K8S_VERSION=1.26.10 - BUILD +$TARGET --K8S_VERSION=1.25.15 - BUILD +$TARGET --K8S_VERSION=1.28.2 - BUILD +$TARGET --K8S_VERSION=1.29.0 BUILD +$TARGET --K8S_VERSION=1.27.9 - BUILD +$TARGET --K8S_VERSION=1.26.12 - BUILD +$TARGET --K8S_VERSION=1.28.5 BUILD +$TARGET --K8S_VERSION=1.27.11 - BUILD +$TARGET --K8S_VERSION=1.26.15 + BUILD +$TARGET --K8S_VERSION=1.28.2 + BUILD +$TARGET --K8S_VERSION=1.28.5 BUILD +$TARGET --K8S_VERSION=1.28.9 + BUILD +$TARGET --K8S_VERSION=1.29.0 ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] - BUILD +$TARGET --K8S_VERSION=1.26.14 - BUILD +$TARGET --K8S_VERSION=1.27.11 - BUILD +$TARGET --K8S_VERSION=1.28.7 - BUILD +$TARGET --K8S_VERSION=1.29.3 BUILD +$TARGET --K8S_VERSION=1.24.6 BUILD +$TARGET --K8S_VERSION=1.25.2 - BUILD +$TARGET --K8S_VERSION=1.26.4 - BUILD +$TARGET --K8S_VERSION=1.27.2 BUILD +$TARGET --K8S_VERSION=1.25.13 + BUILD +$TARGET --K8S_VERSION=1.25.15 + BUILD +$TARGET --K8S_VERSION=1.26.4 BUILD +$TARGET --K8S_VERSION=1.26.8 - BUILD +$TARGET --K8S_VERSION=1.27.5 - BUILD +$TARGET --K8S_VERSION=1.27.7 BUILD +$TARGET --K8S_VERSION=1.26.10 - BUILD +$TARGET --K8S_VERSION=1.25.15 - BUILD +$TARGET --K8S_VERSION=1.28.2 - BUILD +$TARGET --K8S_VERSION=1.27.9 BUILD +$TARGET --K8S_VERSION=1.26.12 - BUILD +$TARGET --K8S_VERSION=1.28.5 + BUILD +$TARGET --K8S_VERSION=1.26.14 BUILD +$TARGET --K8S_VERSION=1.26.15 + BUILD +$TARGET --K8S_VERSION=1.27.2 + BUILD +$TARGET --K8S_VERSION=1.27.5 + BUILD +$TARGET --K8S_VERSION=1.27.7 + BUILD +$TARGET --K8S_VERSION=1.27.9 + BUILD +$TARGET --K8S_VERSION=1.27.11 BUILD +$TARGET --K8S_VERSION=1.27.13 + BUILD +$TARGET --K8S_VERSION=1.28.2 + BUILD +$TARGET --K8S_VERSION=1.28.5 + BUILD +$TARGET --K8S_VERSION=1.28.7 BUILD +$TARGET --K8S_VERSION=1.28.9 + BUILD +$TARGET --K8S_VERSION=1.29.3 BUILD +$TARGET --K8S_VERSION=1.29.4 ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ] - BUILD +$TARGET --K8S_VERSION=1.26.14 - BUILD +$TARGET --K8S_VERSION=1.27.11 - BUILD +$TARGET --K8S_VERSION=1.28.7 - BUILD +$TARGET --K8S_VERSION=1.29.2 BUILD +$TARGET --K8S_VERSION=1.24.6 BUILD +$TARGET --K8S_VERSION=1.25.2 - BUILD +$TARGET --K8S_VERSION=1.26.4 - BUILD +$TARGET --K8S_VERSION=1.27.2 BUILD +$TARGET --K8S_VERSION=1.25.13 + BUILD +$TARGET --K8S_VERSION=1.25.15 + BUILD +$TARGET --K8S_VERSION=1.26.4 BUILD +$TARGET --K8S_VERSION=1.26.8 + BUILD +$TARGET --K8S_VERSION=1.26.10 + BUILD +$TARGET --K8S_VERSION=1.26.14 + BUILD +$TARGET --K8S_VERSION=1.27.2 BUILD +$TARGET --K8S_VERSION=1.27.5 BUILD +$TARGET --K8S_VERSION=1.27.7 - BUILD +$TARGET --K8S_VERSION=1.26.10 - BUILD +$TARGET --K8S_VERSION=1.25.15 + BUILD +$TARGET --K8S_VERSION=1.27.11 BUILD +$TARGET --K8S_VERSION=1.28.2 + BUILD +$TARGET --K8S_VERSION=1.28.7 + BUILD +$TARGET --K8S_VERSION=1.29.2 END ELSE BUILD +$TARGET --K8S_VERSION="$K8S_VERSION" @@ -202,23 +202,23 @@ build-provider-images-fips: BUILD +provider-image --K8S_VERSION=1.24.13 BUILD +provider-image --K8S_VERSION=1.25.9 BUILD +provider-image --K8S_VERSION=1.26.4 - BUILD +provider-image --K8S_VERSION=1.27.2 - BUILD +provider-image --K8S_VERSION=1.29.0 - BUILD +provider-image --K8S_VERSION=1.27.9 BUILD +provider-image --K8S_VERSION=1.26.12 - BUILD +provider-image --K8S_VERSION=1.28.5 BUILD +provider-image --K8S_VERSION=1.26.15 + BUILD +provider-image --K8S_VERSION=1.27.2 + BUILD +provider-image --K8S_VERSION=1.27.9 BUILD +provider-image --K8S_VERSION=1.27.14 + BUILD +provider-image --K8S_VERSION=1.28.5 BUILD +provider-image --K8S_VERSION=1.28.10 + BUILD +provider-image --K8S_VERSION=1.29.0 BUILD +provider-image --K8S_VERSION=1.29.5 ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] BUILD +provider-image --K8S_VERSION=1.24.6 - BUILD +provider-image --K8S_VERSION=1.25.2 BUILD +provider-image --K8S_VERSION=1.25.0 + BUILD +provider-image --K8S_VERSION=1.25.2 BUILD +provider-image --K8S_VERSION=1.26.4 + BUILD +provider-image --K8S_VERSION=1.26.12 BUILD +provider-image --K8S_VERSION=1.26.14 BUILD +provider-image --K8S_VERSION=1.27.2 - BUILD +provider-image --K8S_VERSION=1.26.12 BUILD +provider-image --K8S_VERSION=1.27.9 BUILD +provider-image --K8S_VERSION=1.27.11 BUILD +provider-image --K8S_VERSION=1.28.5 @@ -229,9 +229,9 @@ build-provider-images-fips: BUILD +provider-image --K8S_VERSION=1.24.6 BUILD +provider-image --K8S_VERSION=1.25.2 BUILD +provider-image --K8S_VERSION=1.26.4 - BUILD +provider-image --K8S_VERSION=1.27.2 BUILD +provider-image --K8S_VERSION=1.26.12 BUILD +provider-image --K8S_VERSION=1.26.14 + BUILD +provider-image --K8S_VERSION=1.27.2 BUILD +provider-image --K8S_VERSION=1.27.9 BUILD +provider-image --K8S_VERSION=1.27.11 BUILD +provider-image --K8S_VERSION=1.28.5 From 53f339a89db53779b48a272eb5b84f59e574c662 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Mon, 8 Jul 2024 12:11:14 -0400 Subject: [PATCH 2/9] chore: add deploy func for easy demo setup Signed-off-by: Tyler Gillson --- test/env.example | 4 +-- test/test-two-node.sh | 60 +++++++++++++++++++++++++++++++++---------- 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/test/env.example b/test/env.example index 6de9f39..65e1b9d 100644 --- a/test/env.example +++ b/test/env.example @@ -28,15 +28,13 @@ export DOMAIN=dev.spectrocloud.com export PUBLIC_PACK_REPO_UID= # this varies per Palette tenant, identify via Chrome inspector on Tenant Admin -> Pack Registries page export CLUSTER_NAME=two-node--$(git -C ../stylus describe --always) export CLUSTER_PROFILE_UID= # if left blank, a cluster profile will be created -export CLUSTER_VIP= # choose an unassigned VIP +export CLUSTER_VIP= # choose an unassigned VIP from your static IP range # image vars export EARTHLY_BUILDKIT_CACHE_SIZE_MB=500000 export OCI_REGISTRY=${OCI_REGISTRY:-ttl.sh} export STYLUS_BRANCH=${STYLUS_BRANCH:-2-node} export PROVIDER_K3S_BRANCH=${PROVIDER_K3S_BRANCH:-two-node} -export K3S_VERSION="1.28.5" -export PE_VERSION="4.3.0-2node" # two node vars export TWO_NODE_BACKEND=postgres diff --git a/test/test-two-node.sh b/test/test-two-node.sh index c84607e..d6440c3 100755 --- a/test/test-two-node.sh +++ b/test/test-two-node.sh @@ -14,10 +14,13 @@ set -e # - jq (https://jqlang.github.io/jq/download/) # - mkisofs (https://command-not-found.com/mkisofs) # -# 2. Clone CanvOS and checkout this branch. +# 2. Clone CanvOS and 'git checkout' this branch. # -# 3. Configure your Earthly argument file by running: cp .arg.template .arg -# No modifications to the template are required. +# 3. Configure your Earthly argument file by running: cp .arg.template .arg. +# Ensure the following vars are customized: +# +# K3S_PROVIDER_VERSION=v4.4.2-2node +# K8S_VERSION=1.28.7 (pick any supported K3s version) # # 4. Create a .netrc file in the stylus repo root with GitHub # credentials capable of cloning Spectro Cloud internal repos. @@ -25,10 +28,10 @@ set -e # 5. Copy the test/env.example file to test/.env and edit test/.env # as required. # -# 6. Source and execute this script: +# 6. Source this script and execute 'deploy': # # source ./test/test-two-node.sh -# ./test/test-two-node.sh +# deploy # Do not edit anything below @@ -321,13 +324,13 @@ function prepare_cluster_profile() { jq ' .metadata.name = env.CLUSTER_NAME | .spec.template.packs[0].registry.metadata.uid = env.PUBLIC_PACK_REPO_UID | - .spec.template.packs[1].version = env.K3S_VERSION | - .spec.template.packs[1].tag = env.K3S_VERSION | + .spec.template.packs[1].version = env.K8S_VERSION | + .spec.template.packs[1].tag = env.K8S_VERSION | .spec.template.packs[1].registry.metadata.uid = env.PUBLIC_PACK_REPO_UID | .spec.template.packs[2].registry.metadata.uid = env.PUBLIC_PACK_REPO_UID | .spec.template.packs[0].values |= gsub("OCI_REGISTRY"; env.OCI_REGISTRY) | .spec.template.packs[0].values |= gsub("PE_VERSION"; env.PE_VERSION) | - .spec.template.packs[0].values |= gsub("K3S_VERSION"; env.K3S_VERSION) | + .spec.template.packs[0].values |= gsub("K8S_VERSION"; env.K8S_VERSION) | .spec.template.packs[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH) ' test/templates/two-node-cluster-profile.json.tmpl > two-node-cluster-profile.json } @@ -376,9 +379,9 @@ function prepare_master_master_cluster() { .spec.profiles[0].uid = env.CLUSTER_PROFILE_UID | .spec.profiles[0].packValues[0].values |= gsub("OCI_REGISTRY"; env.OCI_REGISTRY) | .spec.profiles[0].packValues[0].values |= gsub("PE_VERSION"; env.PE_VERSION) | - .spec.profiles[0].packValues[0].values |= gsub("K3S_VERSION"; env.K3S_VERSION) | + .spec.profiles[0].packValues[0].values |= gsub("K8S_VERSION"; env.K8S_VERSION) | .spec.profiles[0].packValues[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH) | - .spec.profiles[0].packValues[1].tag = env.K3S_VERSION + .spec.profiles[0].packValues[1].tag = env.K8S_VERSION ' test/templates/two-node-master-master.json.tmpl > two-node-create.json } @@ -471,9 +474,9 @@ function build_canvos() { --IMAGE_REGISTRY=${OCI_REGISTRY} \ --TWO_NODE=true \ --TWO_NODE_BACKEND=${TWO_NODE_BACKEND} \ - --CUSTOM_TAG=${STYLUS_HASH} \ - --PE_VERSION=v${PE_VERSION} - docker push ${OCI_REGISTRY}/ubuntu:k3s-${K3S_VERSION}-v${PE_VERSION}-${STYLUS_HASH} + --CUSTOM_TAG=${STYLUS_HASH} + + docker push ${OCI_REGISTRY}/ubuntu:k3s-${K8S_VERSION}-v${PE_VERSION}-${STYLUS_HASH} } function build_all() { @@ -501,7 +504,7 @@ function build_all() { ( test -f build/palette-edge-installer-stylus-${STYLUS_HASH}-k3s-${PROVIDER_K3S_HASH}.iso && \ docker image ls --format "{{.Repository}}:{{.Tag}}" | \ - grep -q ${OCI_REGISTRY}/ubuntu:k3s-${K3S_VERSION}-v${PE_VERSION}-${STYLUS_HASH} + grep -q ${OCI_REGISTRY}/ubuntu:k3s-${K8S_VERSION}-v${PE_VERSION}-${STYLUS_HASH} ) || ( build_canvos ) } @@ -512,6 +515,35 @@ function clean_all() { docker system prune --all --volumes --force } +# Builds 2-node provider image and ISO, uploads the ISO to vCenter, and provisions edge hosts +# for deploying a 2-node cluster. +function deploy() { + earthly +build-all-images \ + --ARCH=amd64 \ + --ISO_NAME=palette-edge-installer-stylus-k3s-twonode \ + --IMAGE_REGISTRY=${OCI_REGISTRY} \ + --TWO_NODE=true \ + --TWO_NODE_BACKEND=${TWO_NODE_BACKEND} \ + --CUSTOM_TAG=twonode + + docker push ${OCI_REGISTRY}/ubuntu:k3s-${K8S_VERSION}-v${PE_VERSION}-twonode + + # create & upload user-data ISOs, configured to enable two node mode + create_userdata_iso + upload_userdata_iso + + echo Uploading installer ISO $iso... + iso=palette-edge-installer-stylus-k3s-twonode.iso + govc datastore.upload --ds=$GOVC_DATASTORE --dc=$GOVC_DATACENTER build/$iso $STYLUS_ISO + + vm_array=("two-node-jul8-1" "two-node-jul8-2") + create_vms + wait_for_vms_to_power_off + reboot_vms + + echo Edge hosts should register with Palette shortly. Please proceed to deploying an Edge cluster via the UI. +} + function main() { init_globals From 8331a434b30f810b4e90a04e726fc4d00781cb77 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Mon, 8 Jul 2024 12:18:00 -0400 Subject: [PATCH 3/9] fix: source .arg to fix image push Signed-off-by: Tyler Gillson --- test/test-two-node.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test-two-node.sh b/test/test-two-node.sh index d6440c3..9e40eaf 100755 --- a/test/test-two-node.sh +++ b/test/test-two-node.sh @@ -2,6 +2,8 @@ set -e +source .arg + # Usage # ----- # From 2ef955f58836f5b408b8697b02c7acf1e806b3e9 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Mon, 8 Jul 2024 12:19:47 -0400 Subject: [PATCH 4/9] chore: update default 2-node args Signed-off-by: Tyler Gillson --- Earthfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Earthfile b/Earthfile index 0d1457c..cf8f549 100644 --- a/Earthfile +++ b/Earthfile @@ -19,7 +19,7 @@ ARG RKE2_FLAVOR_TAG=rke2r1 ARG BASE_IMAGE_URL=quay.io/kairos ARG OSBUILDER_VERSION=v0.201.0 ARG OSBUILDER_IMAGE=quay.io/kairos/osbuilder-tools:$OSBUILDER_VERSION -ARG K3S_PROVIDER_VERSION=v4.4.2 +ARG K3S_PROVIDER_VERSION=v4.4.2-2node ARG KUBEADM_PROVIDER_VERSION=v4.4.1 ARG RKE2_PROVIDER_VERSION=v4.4.1 @@ -52,7 +52,7 @@ ARG UPDATE_KERNEL=false ARG ETCD_VERSION="v3.5.13" # Two node variables -ARG TWO_NODE=false +ARG TWO_NODE=true ARG KINE_VERSION=0.11.4 # UKI Variables From 270c3c74e50529a9a5f69e4ab5567864120c4a63 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Tue, 17 Sep 2024 18:26:40 -0400 Subject: [PATCH 5/9] test: add twoNode flag, tidy deploy func Signed-off-by: Tyler Gillson --- test/test-two-node.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/test/test-two-node.sh b/test/test-two-node.sh index 9e40eaf..dc58815 100755 --- a/test/test-two-node.sh +++ b/test/test-two-node.sh @@ -83,6 +83,8 @@ stylus: users: - name: kairos passwd: kairos + twoNode: + enable: true site: edgeHostToken: "$EDGE_REGISTRATION_TOKEN" paletteEndpoint: "$DOMAIN" @@ -520,7 +522,9 @@ function clean_all() { # Builds 2-node provider image and ISO, uploads the ISO to vCenter, and provisions edge hosts # for deploying a 2-node cluster. function deploy() { - earthly +build-all-images \ + set +e + + earthly --push +build-all-images \ --ARCH=amd64 \ --ISO_NAME=palette-edge-installer-stylus-k3s-twonode \ --IMAGE_REGISTRY=${OCI_REGISTRY} \ @@ -528,8 +532,6 @@ function deploy() { --TWO_NODE_BACKEND=${TWO_NODE_BACKEND} \ --CUSTOM_TAG=twonode - docker push ${OCI_REGISTRY}/ubuntu:k3s-${K8S_VERSION}-v${PE_VERSION}-twonode - # create & upload user-data ISOs, configured to enable two node mode create_userdata_iso upload_userdata_iso @@ -538,12 +540,13 @@ function deploy() { iso=palette-edge-installer-stylus-k3s-twonode.iso govc datastore.upload --ds=$GOVC_DATASTORE --dc=$GOVC_DATACENTER build/$iso $STYLUS_ISO - vm_array=("two-node-jul8-1" "two-node-jul8-2") + vm_array=("two-node-sep16-1" "two-node-sep16-2") create_vms wait_for_vms_to_power_off reboot_vms echo Edge hosts should register with Palette shortly. Please proceed to deploying an Edge cluster via the UI. + set -e } function main() { From d56f3c179008d22944ee6b0125eb2eb53ccf42b9 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Thu, 19 Sep 2024 13:59:11 -0400 Subject: [PATCH 6/9] fix: use --push instead of manually pushing images Signed-off-by: Tyler Gillson --- test/test-two-node.sh | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/test/test-two-node.sh b/test/test-two-node.sh index dc58815..53d8db5 100755 --- a/test/test-two-node.sh +++ b/test/test-two-node.sh @@ -450,27 +450,24 @@ function update_cluster() { function build_provider_k3s() { echo "Building provider-k3s image..." - earthly +build-provider-package \ + earthly --push +build-provider-package \ --platform=linux/amd64 \ --IMAGE_REPOSITORY=${OCI_REGISTRY} \ --VERSION=${PROVIDER_K3S_HASH} - docker push ${OCI_REGISTRY}/provider-k3s:${PROVIDER_K3S_HASH} } function build_stylus_package_and_framework() { echo "Building stylus image and stylus framework image..." - earthly --allow-privileged +package \ + earthly --allow-privileged --push +package \ --platform=linux/amd64 \ --IMAGE_REPOSITORY=${OCI_REGISTRY} \ --BASE_IMAGE=quay.io/kairos/core-opensuse-leap:v2.3.2 \ --VERSION=v0.0.0-${STYLUS_HASH} - docker push ${OCI_REGISTRY}/stylus-linux-amd64:v0.0.0-${STYLUS_HASH} - docker push ${OCI_REGISTRY}/stylus-framework-linux-amd64:v0.0.0-${STYLUS_HASH} } function build_canvos() { echo "Building provider image & installer ISO..." - earthly +build-all-images \ + earthly --push +build-all-images \ --ARCH=amd64 \ --PROVIDER_BASE=${OCI_REGISTRY}/provider-k3s:${PROVIDER_K3S_HASH} \ --STYLUS_BASE=${OCI_REGISTRY}/stylus-framework-linux-amd64:v0.0.0-${STYLUS_HASH} \ @@ -479,8 +476,6 @@ function build_canvos() { --TWO_NODE=true \ --TWO_NODE_BACKEND=${TWO_NODE_BACKEND} \ --CUSTOM_TAG=${STYLUS_HASH} - - docker push ${OCI_REGISTRY}/ubuntu:k3s-${K8S_VERSION}-v${PE_VERSION}-${STYLUS_HASH} } function build_all() { From 6d217b447368179ce9ac6b5b6b05ae98aa9a7bc7 Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Thu, 19 Sep 2024 15:27:41 -0400 Subject: [PATCH 7/9] fix: update example; write manifests to /tmp Signed-off-by: Tyler Gillson --- test/env.example | 1 + test/test-two-node.sh | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/env.example b/test/env.example index 65e1b9d..65f4e8f 100644 --- a/test/env.example +++ b/test/env.example @@ -35,6 +35,7 @@ export EARTHLY_BUILDKIT_CACHE_SIZE_MB=500000 export OCI_REGISTRY=${OCI_REGISTRY:-ttl.sh} export STYLUS_BRANCH=${STYLUS_BRANCH:-2-node} export PROVIDER_K3S_BRANCH=${PROVIDER_K3S_BRANCH:-two-node} +export PE_VERSION=4.4.12 # two node vars export TWO_NODE_BACKEND=postgres diff --git a/test/test-two-node.sh b/test/test-two-node.sh index 53d8db5..02ad206 100755 --- a/test/test-two-node.sh +++ b/test/test-two-node.sh @@ -336,7 +336,7 @@ function prepare_cluster_profile() { .spec.template.packs[0].values |= gsub("PE_VERSION"; env.PE_VERSION) | .spec.template.packs[0].values |= gsub("K8S_VERSION"; env.K8S_VERSION) | .spec.template.packs[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH) - ' test/templates/two-node-cluster-profile.json.tmpl > two-node-cluster-profile.json + ' test/templates/two-node-cluster-profile.json.tmpl > /tmp/two-node-cluster-profile.json } function create_cluster_profile() { @@ -344,8 +344,7 @@ function create_cluster_profile() { -H "ApiKey: $API_KEY" \ -H "Content-Type: application/json" \ -H "ProjectUid: $PROJECT_UID" \ - -d @two-node-cluster-profile.json | jq -r .uid) - rm -f two-node-cluster-profile.json + -d @/tmp/two-node-cluster-profile.json | jq -r .uid) if [ "$CLUSTER_PROFILE_UID" = "null" ]; then echo Cluster Profile creation failed as it already exists. Please delete it and retry. return 1 @@ -386,7 +385,7 @@ function prepare_master_master_cluster() { .spec.profiles[0].packValues[0].values |= gsub("K8S_VERSION"; env.K8S_VERSION) | .spec.profiles[0].packValues[0].values |= gsub("STYLUS_HASH"; env.STYLUS_HASH) | .spec.profiles[0].packValues[1].tag = env.K8S_VERSION - ' test/templates/two-node-master-master.json.tmpl > two-node-create.json + ' test/templates/two-node-master-master.json.tmpl > /tmp/two-node-create.json } function create_cluster() { @@ -394,12 +393,11 @@ function create_cluster() { -H "ApiKey: $API_KEY" \ -H "Content-Type: application/json" \ -H "ProjectUid: $PROJECT_UID" \ - -d @two-node-create.json | jq -r .uid) + -d @/tmp/two-node-create.json | jq -r .uid) if [ "$uid" = "null" ]; then echo "Cluster creation failed. Please check two-node-create.json and retry creation manually to see Hubble's response." return 1 else - rm -f two-node-create.json echo "Cluster $uid created" fi } From 3817889c633642cf17e7f5ce09b2eedd2773ecad Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Thu, 19 Sep 2024 15:59:35 -0400 Subject: [PATCH 8/9] chore: add K8S_VERSION to sample env Signed-off-by: Tyler Gillson --- test/env.example | 1 + 1 file changed, 1 insertion(+) diff --git a/test/env.example b/test/env.example index 65f4e8f..befe472 100644 --- a/test/env.example +++ b/test/env.example @@ -36,6 +36,7 @@ export OCI_REGISTRY=${OCI_REGISTRY:-ttl.sh} export STYLUS_BRANCH=${STYLUS_BRANCH:-2-node} export PROVIDER_K3S_BRANCH=${PROVIDER_K3S_BRANCH:-two-node} export PE_VERSION=4.4.12 +export K8S_VERSION=1.29.6 # two node vars export TWO_NODE_BACKEND=postgres From cbe5136bc8cbc43d9b24810feb596fe8fc6bb4ee Mon Sep 17 00:00:00 2001 From: Tyler Gillson Date: Thu, 19 Sep 2024 18:18:10 -0400 Subject: [PATCH 9/9] fix: K3S_VERSION -> K8S_VERSION; include TUI Signed-off-by: Tyler Gillson --- test/templates/two-node-cluster-profile.json.tmpl | 2 +- test/templates/two-node-master-master.json.tmpl | 2 +- test/test-two-node.sh | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/test/templates/two-node-cluster-profile.json.tmpl b/test/templates/two-node-cluster-profile.json.tmpl index 5f68898..ecf729b 100644 --- a/test/templates/two-node-cluster-profile.json.tmpl +++ b/test/templates/two-node-cluster-profile.json.tmpl @@ -16,7 +16,7 @@ "layer": "os", "version": "1.0.0", "tag": "1.0.0", - "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-K3S_VERSION-vPE_VERSION-STYLUS_HASH\"", + "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-K8S_VERSION-vPE_VERSION-STYLUS_HASH\"", "registry": { "metadata": { "uid": "_____place_holder_____", diff --git a/test/templates/two-node-master-master.json.tmpl b/test/templates/two-node-master-master.json.tmpl index 1dcd625..719676b 100644 --- a/test/templates/two-node-master-master.json.tmpl +++ b/test/templates/two-node-master-master.json.tmpl @@ -67,7 +67,7 @@ "tag": "1.0.0", "name": "edge-native-byoi", "type": "spectro", - "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-K3S_VERSION-vPE_VERSION-STYLUS_HASH\"", + "values": "pack:\n content:\n images:\n - image: \"{{.spectro.pack.edge-native-byoi.options.system.uri}}\"\n # Below config is default value, please uncomment if you want to modify default values\n #drain:\n #cordon: true\n #timeout: 60 # The length of time to wait before giving up, zero means infinite\n #gracePeriod: 60 # Period of time in seconds given to each pod to terminate gracefully. If negative, the default value specified in the pod will be used\n #ignoreDaemonSets: true\n #deleteLocalData: true # Continue even if there are pods using emptyDir (local data that will be deleted when the node is drained)\n #force: true # Continue even if there are pods that do not declare a controller\n #disableEviction: false # Force drain to use delete, even if eviction is supported. This will bypass checking PodDisruptionBudgets, use with caution\n #skipWaitForDeleteTimeout: 60 # If pod DeletionTimestamp older than N seconds, skip waiting for the pod. Seconds must be greater than 0 to skip.\nstylusPackage: container://OCI_REGISTRY/stylus-linux-amd64:v0.0.0-STYLUS_HASH\noptions:\n system.uri: \"OCI_REGISTRY/ubuntu:k3s-K8S_VERSION-vPE_VERSION-STYLUS_HASH\"", "manifests": [] }, { diff --git a/test/test-two-node.sh b/test/test-two-node.sh index 02ad206..173718a 100755 --- a/test/test-two-node.sh +++ b/test/test-two-node.sh @@ -83,6 +83,7 @@ stylus: users: - name: kairos passwd: kairos + includeTui: true twoNode: enable: true site: