-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PAD-173: 2 node HA - Tech Preview (#131)
* PAD-156: Add custom health check script * PAD-156: Update user-data template, include health-check-script * Add E2E automation, debug helpers (#94) * automate e2e provisioning * chore: bump provider-k3s version --------- Signed-off-by: Oz Tiram <[email protected]> Signed-off-by: Tyler Gillson <[email protected]> Signed-off-by: Oz N Tiram <[email protected]> Co-authored-by: Oz Tiram <[email protected]>
- Loading branch information
1 parent
94c5a17
commit bc880b3
Showing
13 changed files
with
974 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
VERSION 0.6 | ||
|
||
ARG OSBUILDER_VERSION=v0.7.11 | ||
ARG OSBUILDER_IMAGE=quay.io/kairos/osbuilder-tools:$OSBUILDER_VERSION | ||
ARG ISO_NAME=debug | ||
|
||
# replace with your CanvOS provider image | ||
ARG PROVIDER_IMAGE=oci:tylergillson/ubuntu:k3s-1.26.4-v4.0.4-071c2c23 | ||
|
||
build: | ||
FROM $OSBUILDER_IMAGE | ||
WORKDIR /build | ||
COPY . ./ | ||
|
||
RUN /entrypoint.sh --name $ISO_NAME --debug build-iso --squash-no-compression --date=false $PROVIDER_IMAGE --output /build/ | ||
SAVE ARTIFACT /build/$ISO_NAME.iso kairos.iso AS LOCAL build/$ISO_NAME.iso |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Debugging Kairos | ||
|
||
If you're facing hard-to-diagnose issues with your custom provider image, you can use the scripts in this directory to obtain verbose Kairos output. | ||
|
||
## Steps | ||
1. Use earthly to generate an ISO from your CanvOS provider image: | ||
``` | ||
earthly +build --PROVIDER_IMAGE=<your_provider_image> # e.g., oci:tylergillson/ubuntu:k3s-1.26.4-v4.0.4-071c2c23 | ||
``` | ||
If successful, `build/debug.iso` will be created. | ||
2. Launch a local VM based on the debug ISO using QEMU and pipe all output to a log file: | ||
``` | ||
./launch-qemu.sh build/debug.iso | tee out.log | ||
``` | ||
3. Boot the VM in `Kairos (manual)` mode. Once booted, create `userdata.yaml` with your desired Kairos config and execute a manual Kairos installation: `kairos-agent --debug manual-install --device auto userdata.yaml`. | ||
4. The VM should eventually reboot itself once the installation completes. Rather than waiting, execute `reboot` to return to the GRUB menu, select `Palette eXtended Kubernetes Edge` and hit `e` to edit it. Add `rd.debug rd.immucore.debug` to the end of the `linux` line, then hit `CTRL+x` to boot with your edits. You should see verbose Kairos debug logs and they will be persisted to `out.log`. |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
# Screenshot capability: | ||
# https://unix.stackexchange.com/a/476617 | ||
|
||
if [ ! -e disk.img ]; then | ||
qemu-img create -f qcow2 disk.img 60g | ||
fi | ||
|
||
# -nic bridge,br=br0,model=virtio-net-pci \ | ||
qemu-system-x86_64 \ | ||
-enable-kvm \ | ||
-cpu "${CPU:=host}" \ | ||
-nographic \ | ||
-spice port=9000,addr=127.0.0.1,disable-ticketing=yes \ | ||
-m ${MEMORY:=10096} \ | ||
-smp ${CORES:=5} \ | ||
-monitor unix:/tmp/qemu-monitor.sock,server=on,wait=off \ | ||
-serial mon:stdio \ | ||
-rtc base=utc,clock=rt \ | ||
-chardev socket,path=qga.sock,server=on,wait=off,id=qga0 \ | ||
-device virtio-serial \ | ||
-device virtserialport,chardev=qga0,name=org.qemu.guest_agent.0 \ | ||
-drive if=virtio,media=disk,file=disk.img \ | ||
-drive if=ide,media=cdrom,file="${1}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
REQUIRED_FREE_DISK=$1 | ||
|
||
FREE=$(df -h --output=pcent /var/ | tail -n 1 | tr -d '\% ') | ||
|
||
if (( $FREE < $REQUIRED_FREE_DISK )); then | ||
echo "Not enough free disk, required: $1. Free: $FREE" | ||
exit 1 | ||
fi | ||
|
||
echo "Free disk ok, required: $1. Free: $FREE" | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# govc vars | ||
export GOVC_USERNAME=<YOUR_NAME>@vsphere.local | ||
export GOVC_PASSWORD=<YOUR_VSPHERE_PASSWORD> | ||
export GOVC_URL=10.10.128.10 # IP address of USDC; edit as needed | ||
export GOVC_INSECURE=true | ||
export GOVC_DATACENTER=Datacenter | ||
export GOVC_DATASTORE=vsanDatastore2 | ||
export GOVC_NETWORK=VM-NETWORK | ||
export GOVC_RESOURCE_POOL=<YOUR_RESOURCE_POOL> | ||
export GOVC_FOLDER=<YOUR_FOLDER> | ||
|
||
# vSphere vars | ||
export HOST_SUFFIX=<YOUR_NAME>-$(git -C ../stylus describe --always) # required to ensure unique edge host IDs | ||
export ISO_FOLDER=<YOUR_FOLDER> e.g. "ISO/01-tyler" | ||
export STYLUS_ISO="${ISO_FOLDER}/stylus-dev-amd64.iso" | ||
export NIC_NAME=ens160 | ||
|
||
# networking vars | ||
export PROXY= # set any value to use Spectro's basic proxy | ||
export WIFI_NETWORK= | ||
export WIFI_PASSWORD= | ||
|
||
# palette vars | ||
export API_KEY=<YOUR_PALETTE_API_KEY> | ||
export PROJECT_UID=<YOUR_PROJECT_ID> | ||
export EDGE_REGISTRATION_TOKEN=<YOUR_REGISTRATION_TOKEN> | ||
export DOMAIN=dev.spectrocloud.com | ||
export PUBLIC_PACK_REPO_UID=<YOUR_PUBLIC_PACK_REPO_UID> # this varies per Palette tenant, identify via Chrome inspector on Tenant Admin -> Pack Registries page | ||
export CLUSTER_NAME=two-node-<YOUR_NAME>-$(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 | ||
|
||
# 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 |
Oops, something went wrong.