-
Notifications
You must be signed in to change notification settings - Fork 47
/
deploy-kubevirt-and-cdi.sh
executable file
·59 lines (49 loc) · 1.48 KB
/
deploy-kubevirt-and-cdi.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
set -e
source $(dirname "$0")/versions.sh
NAMESPACE=${1:-kubevirt}
oc apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: ${NAMESPACE}
EOF
# Deploying kuebvirt
oc apply -n $NAMESPACE -f "https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml"
# Using KubeVirt CR from version v0.59.0
oc apply -n $NAMESPACE -f - <<EOF
apiVersion: kubevirt.io/v1
kind: KubeVirt
metadata:
name: kubevirt
namespace: kubevirt
spec:
certificateRotateStrategy: {}
configuration:
developerConfiguration:
featureGates:
- DataVolumes
- CPUManager
- LiveMigration
- KubevirtSeccompProfile
seccompConfiguration:
virtualMachineInstanceProfile:
customProfile:
localhostProfile: kubevirt/kubevirt.json
customizeComponents: {}
imagePullPolicy: Always
EOF
echo "Waiting for Kubevirt to be ready..."
oc wait --for=condition=Available --timeout=600s -n $NAMESPACE kv/kubevirt
# Deploying CDI
CDI_NAMESPACE=cdi
oc apply -f - <<EOF
apiVersion: v1
kind: Namespace
metadata:
name: $CDI_NAMESPACE
EOF
oc apply -n ${CDI_NAMESPACE} -f "https://github.com/kubevirt/containerized-data-importer/releases/download/${CDI_VERSION}/cdi-operator.yaml"
oc apply -n ${CDI_NAMESPACE} -f "https://github.com/kubevirt/containerized-data-importer/releases/download/${CDI_VERSION}/cdi-cr.yaml"
echo "Waiting for CDI to be ready..."
oc wait --for=condition=Available --timeout=600s -n ${CDI_NAMESPACE} cdi/cdi