forked from askblaker/k3s.rocks
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmultipass.sh
executable file
·32 lines (21 loc) · 1.25 KB
/
multipass.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/bash
multipass launch --name testvm --mem 4G --disk 10G --cpus 2 focal
read TESTVMIP < <(multipass info testvm | grep IPv4 | grep -o '[0-9]\+[.][0-9]\+[.][0-9]\+[.][0-9]\+')
echo "TESTVMPIP=${TESTVMIP}"
COMMAND="$(cat ./scripts/install_update_open_scsi_wireguard.txt)"
multipass exec testvm -- bash -c "${COMMAND}"
COMMAND="$(cat ./scripts/install_arkade_helm_kubectl.txt)"
#multipass exec testvm -- bash -c "${COMMAND}"
COMMAND="$(cat ./scripts/git_clone_k3s.rocks.txt)"
#multipass exec testvm -- bash -c "${COMMAND}"
multipass mount ${PWD} testvm:./k3s.rocks
COMMAND="$(cat ./scripts/install_k3s_regular.txt)"
multipass exec testvm -- bash -c "${COMMAND}"
multipass exec testvm -- bash -c "KUBECONFIG=/etc/rancher/k3s/k3s.yaml bash ./k3s.rocks/scripts/whoami_deployment.txt"
multipass exec testvm -- bash -c "KUBECONFIG=/etc/rancher/k3s/k3s.yaml bash ./k3s.rocks/scripts/whoami_service.txt"
multipass exec testvm -- bash -c "KUBECONFIG=/etc/rancher/k3s/k3s.yaml bash ./k3s.rocks/scripts/whoami_ingress.txt"
echo "Give services some time to start..."
sleep 120
echo "Continuing..."
if [[ $(curl ${TESTVMIP}/fy) != "404 page not found" ]]; then exit 1; fi
if [ $( curl ${TESTVMIP}/foo | grep -c whoami ) != 0 ]; then echo "Whoami service found"; else exit 1; fi