Add examples with kubevirt

* Add helpers to install kubevirt and its dependencies
* Add examples how to use kubevirt

Related-Prod: PRODX-3456
Change-Id: I3ade65df5f8ddff39f35605104851833d74690a1
diff --git a/kubevirt/examples/02-boot-vm-cdi/cirros.yaml b/kubevirt/examples/02-boot-vm-cdi/cirros.yaml
new file mode 100644
index 0000000..1c9ec30
--- /dev/null
+++ b/kubevirt/examples/02-boot-vm-cdi/cirros.yaml
@@ -0,0 +1,36 @@
+---
+apiVersion: kubevirt.io/v1
+kind: VirtualMachine
+metadata:
+  labels:
+    kubevirt.io/vm: cirros-cdi-pvc
+  name: cirros-cdi-pvc
+spec:
+  running: false
+  template:
+    metadata:
+      labels:
+        kubevirt.io/vm: cirros-cdi-pvc
+    spec:
+      domain:
+        devices:
+          disks:
+          - disk:
+              bus: virtio
+            name: cdi-pvc
+          - disk:
+              bus: virtio
+            name: cloudinitdisk
+        resources:
+          requests:
+            memory: 128Mi
+      terminationGracePeriodSeconds: 0
+      volumes:
+      - name: cdi-pvc
+        persistentVolumeClaim:
+          claimName: cirros-cdi-pvc
+      - cloudInitNoCloud:
+          userData: |
+            #!/bin/sh
+            echo 'printed from cloud-init userdata'
+        name: cloudinitdisk
diff --git a/kubevirt/examples/02-boot-vm-cdi/run.sh b/kubevirt/examples/02-boot-vm-cdi/run.sh
new file mode 100755
index 0000000..6078a57
--- /dev/null
+++ b/kubevirt/examples/02-boot-vm-cdi/run.sh
@@ -0,0 +1,40 @@
+EXAMPLES_DIR=$(cd $(dirname "$0")/.. && pwd)
+WORKDIR=$(cd $(dirname "$0") && pwd)
+
+TMP_DIR=$(cd $(dirname "$0")/../../.workdir/ && pwd)
+source ${EXAMPLES_DIR}/lib.sh
+
+command=$1
+
+function run {
+    echo "Downloading cirros"
+    if [[ ! -f ${TMP_DIR}/cirros-0.6.2-x86_64-disk.img ]]; then
+        wget https://download.cirros-cloud.net/0.6.2/cirros-0.6.2-x86_64-disk.img -O ${TMP_DIR}/cirros-0.6.2-x86_64-disk.img
+    fi
+
+    echo "Uploading cirros to PVC."
+    UPLOADPROXY_URL=https://$(kubectl get nodes  -o wide| tail -1  | awk '{print $6}'):31119
+    virtctl image-upload pvc cirros-cdi-pvc --size 5G --image-path=${TMP_DIR}/cirros-0.6.2-x86_64-disk.img --insecure --uploadproxy-url ${UPLOADPROXY_URL}
+
+    kubectl get pvc
+    kubectl get pods
+
+    echo "Creating VM"
+    kubectl apply -f cirros.yaml
+
+    echo "Starting VM"
+    virtctl start cirros-cdi-pvc
+
+    echo "Waiting VM is Running."
+    wait_vm_state cirros-cdi-pvc Running
+}
+
+function cleanup {
+    kubectl delete -f cirros.yaml
+    kubectl delete datavolume cirros-cdi-pvc
+    kubectl delete pvc cirros-cdi-pvc
+}
+
+pushd $WORKDIR
+$command
+popd