kubevirt addon: inline KubeVirt CR definition
parent
2f6238b465
commit
afcaf3cd0b
|
@ -10,7 +10,7 @@ data:
|
|||
uninstall.sh: |
|
||||
#!/bin/bash
|
||||
|
||||
kubectl delete -f /manifests/kubevirt-cr.yaml
|
||||
kubectl delete kubevirt kubevirt -n kubevirt
|
||||
|
||||
kubectl delete -f /manifests/kubevirt-operator.yaml
|
||||
|
||||
|
@ -18,18 +18,38 @@ data:
|
|||
#!/bin/bash
|
||||
|
||||
export KUBEVIRT_VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases | grep tag_name | grep -v -- - | sort -V | tail -1 | awk -F':' '{print $2}' | sed 's/,//' | xargs)
|
||||
echo $KUBEVIRT_VERSION
|
||||
echo "Installing KubeVirt version: $KUBEVIRT_VERSION"
|
||||
|
||||
curl -Ls "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml" -o /manifests/kubevirt-operator.yaml
|
||||
kubectl create -f /manifests/kubevirt-operator.yaml
|
||||
|
||||
curl -sL "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml" -o /manifests/kubevirt-cr.yaml
|
||||
kubectl create -f /manifests/kubevirt-cr.yaml
|
||||
HARDWARE_EMULATION=$(egrep 'svm|vmx' /proc/cpuinfo)
|
||||
if [ -z "$HARDWARE_EMULATION" ]; then
|
||||
echo "Using software emulation"
|
||||
|
||||
echo "
|
||||
apiVersion: kubevirt.io/v1
|
||||
kind: KubeVirt
|
||||
metadata:
|
||||
name: kubevirt
|
||||
namespace: kubevirt
|
||||
spec:
|
||||
configuration:
|
||||
developerConfiguration:
|
||||
useEmulation: true
|
||||
" | kubectl apply -f -
|
||||
|
||||
else
|
||||
|
||||
echo "
|
||||
apiVersion: kubevirt.io/v1
|
||||
kind: KubeVirt
|
||||
metadata:
|
||||
name: kubevirt
|
||||
namespace: kubevirt
|
||||
spec: {}
|
||||
" | kubectl apply -f -
|
||||
|
||||
EMULATION=$(egrep 'svm|vmx' /proc/cpuinfo)
|
||||
if [ -z "$EMULATION" ]; then
|
||||
echo "use emulation"
|
||||
kubectl patch kubevirt kubevirt -n kubevirt --type merge --patch '{"spec": {"configuration": {"developerConfiguration": {"useEmulation": true}}}}'
|
||||
fi
|
||||
|
||||
sleep infinity
|
||||
|
|
Loading…
Reference in New Issue