Files
Harvester.BootstrapHARancher/packages/infrastructure/zarf.yaml

60 lines
2.0 KiB
YAML

kind: ZarfPackageConfig
metadata:
name: harvester-bootstrap-rancher
# version: 26.0.0
# description: |
# "Deploys a HA k3s cluster on top of a Harvester cluster, installs Rancher and imports the Harvester local cluster"
variables:
- name: KUBEVIP_ADDRESS
prompt: true
pattern: ^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
components:
- name: provision-cluster
required: true
manifests:
- name: cluster-specs
files:
- manifests/cloud-config-secret.yaml
- manifests/harvester-vms.yaml
actions:
onRemove:
after:
- cmd: |
./zarf tools kubectl get pvc -n default --no-headers | \
awk '/^kairos-node-/ {print $1}' | \
xargs -I {} ./zarf tools kubectl delete pvc -n default {}
- name: retrieve-kubeconfig
required: true
actions:
onDeploy:
before:
- wait:
network:
protocol: tcp
address: "${ZARF_VAR_KUBEVIP_ADDRESS}:6443"
maxTotalSeconds: 600
after:
- cmd: |
ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o ConnectTimeout=5 kairos@${ZARF_VAR_KUBEVIP_ADDRESS} "sudo cat /etc/rancher/k3s/k3s.yaml" > harvester-kairos.yaml
sed -i "s/127.0.0.1/${ZARF_VAR_KUBEVIP_ADDRESS}/g" harvester-kairos.yaml
maxRetries: 10
- name: prepare-payload
required: true
files:
- source: "../../init/zarf-init-amd64-v0.74.2.tar.zst"
target: "zarf-init.tar.zst"
- source: "../../build/zarf-package-deploy-kairos-operator-amd64.tar.zst"
target: "kairos-operator.tar.zst"
- name: invoke-deployment-kairos-operator
required: true
actions:
onDeploy:
after:
- cmd: |
export KUBECONFIG=harvester-kairos.yaml
./zarf init zarf-init.tar.zst --confirm --log-level warn
./zarf package deploy kairos-operator.tar.zst --confirm --log-level warn