forked from harvester/harvester-installer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI: Enable software-emulation for nested VMs
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
- Loading branch information
1 parent
05d0d38
commit 20b97d3
Showing
4 changed files
with
82 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash -ex | ||
|
||
if [[ $# != 1 ]] | ||
then | ||
echo "We need the settings.yaml from ipxe repo" | ||
exit 1 | ||
fi | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/" &> /dev/null && pwd )" | ||
IN_SCRIPT_DIR=$SCRIPT_DIR/in-scripts | ||
|
||
SETTINGS=$1 | ||
SSHKEY="$SCRIPT_DIR/tmp-ssh-key" | ||
NODE0_IP=$(yq e ".harvester_network_config.cluster[0].ip" ${SETTINGS}) | ||
|
||
ssh-keygen -R ${NODE0_IP} || true | ||
|
||
scp -o "StrictHostKeyChecking no" -i ${SSHKEY} $IN_SCRIPT_DIR/patch-kubevirt.sh rancher@$NODE0_IP:/tmp/ | ||
ssh -o "StrictHostKeyChecking no" -i ${SSHKEY} rancher@$NODE0_IP sudo -i /tmp/patch-kubevirt.sh |
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,34 @@ | ||
#!/bin/bash -ex | ||
|
||
wait_kubevirt() { | ||
# Wait for kubevirt to be deployed | ||
namespace=$1 | ||
name=$2 | ||
|
||
echo "Waiting for KubeVirt to be deployed..." | ||
while [ true ]; do | ||
kubevirt=$(kubectl get kubevirts.kubevirt.io $name -n $namespace -o yaml) | ||
|
||
current_phase=$(echo "$kubevirt" | yq e '.status.phase' -) | ||
if [ "$current_phase" = "Deployed" ]; then | ||
echo "KubeVirt is deployed" | ||
break | ||
fi | ||
|
||
echo "KubeVirt current phase: $current_phase" | ||
sleep 5 | ||
done | ||
} | ||
|
||
MANIFEST=$(mktemp --suffix=.yml) | ||
trap "rm -f $MANIFEST" EXIT | ||
|
||
cat >$MANIFEST<<EOF | ||
spec: | ||
configuration: | ||
developerConfiguration: | ||
useEmulation: true | ||
EOF | ||
|
||
kubectl patch kubevirts.kubevirt.io/kubevirt -n harvester-system --patch-file $MANIFEST --type merge | ||
wait_kubevirt harvester-system kubevirt |
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