Scaffolding for nested zarf infrastructure/workloads packages
This commit is contained in:
74
packages/infrastructure/zarf.yaml
Normal file
74
packages/infrastructure/zarf.yaml
Normal file
@@ -0,0 +1,74 @@
|
||||
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 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: deploy-kairosoperator
|
||||
required: true
|
||||
files:
|
||||
- source: "manifests/kairos-operator-rendered.yaml"
|
||||
target: "kairos-operator.yaml"
|
||||
- source: "https://charts.jetstack.io/charts/cert-manager-v1.20.1.tgz"
|
||||
target: "cert-manager.tgz"
|
||||
|
||||
images:
|
||||
- quay.io/jetstack/cert-manager-controller:v1.20.1
|
||||
- quay.io/jetstack/cert-manager-webhook:v1.20.1
|
||||
- quay.io/jetstack/cert-manager-cainjector:v1.20.1
|
||||
- quay.io/kairos/operator:v0.0.7
|
||||
|
||||
actions:
|
||||
onDeploy:
|
||||
before:
|
||||
- cmd: |
|
||||
export KUBECONFIG=harvester-kairos.yaml
|
||||
./zarf tools helm install cert-manager cert-manager.tgz \
|
||||
--namespace cert-manager --create-namespace \
|
||||
--set installCRDs=true \
|
||||
--set global.imageRegistry=${ZARF_VAR_REGISTRY_HOST}:31999 \
|
||||
--wait
|
||||
description: "Installing Cert-Manager on NEW cluster"
|
||||
|
||||
after:
|
||||
- cmd: |
|
||||
export KUBECONFIG=harvester-kairos.yaml
|
||||
sed -i "s|quay.io|${ZARF_VAR_REGISTRY_HOST}:31999/quay.io|g" kairos-operator.yaml
|
||||
./zarf tools kubectl apply -f kairos-operator.yaml
|
||||
description: "Deploying Kairos Operator to NEW cluster"
|
||||
Reference in New Issue
Block a user