Difficulty: beginner
Estimated Time: 5min

This scenario demonstrates how kubevirt can be used to start a virtual machine

Well done, you have completed the KubeVirt demo!

Hope you've enjoyed it, for more information about Kubevirt, please do check https://kubevirt.io!

KubeVirt Demo

Step 1 of 2

Launch cluster and deploy KubeVirt

Wait for the cluster to be ready

Before we can start, we need to wait for the Kubernetes cluster to be ready

Deploy KubeVirt

Deploy KubeVirt operator using latest Kubevirt Version

export KUBEVIRT_VERSION=$(curl -s https://api.github.com/repos/kubevirt/kubevirt/releases|grep tag_name|sort -V | tail -1 | awk -F':' '{print $2}' | sed 's/,//' | xargs) echo $KUBEVIRT_VERSION

kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml

Provide some initial configuration

kubectl create configmap kubevirt-config -n kubevirt --from-literal debug.useEmulation=true

Above commands enables 'emulation' to run the VM's as our demo environment is using 'emulated' virtualization.

Now let's deploy kubevirt by creating a custom resource:

kubectl create -f https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-cr.yaml

Let's check the deployment: kubectl get pods -n kubevirt

Once it's ready, it will show something similar to:

master $ kubectl get pods -n kubevirt
NAME                               READY     STATUS    RESTARTS   AGE
virt-api-7fc57db6dd-g4s4w          1/1       Running   0          3m
virt-api-7fc57db6dd-zd95q          1/1       Running   0          3m
virt-controller-6849d45bcc-88zd4   1/1       Running   0          3m
virt-controller-6849d45bcc-cmfzk   1/1       Running   0          3m
virt-handler-fvsqw                 1/1       Running   0          3m
virt-operator-5649f67475-gmphg     1/1       Running   0          4m
virt-operator-5649f67475-sw78k     1/1       Running   0          4m

Install Virtctl

virtctl is a client utility to provide some more convenient ways to interact with the VM:

wget -O virtctl https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/virtctl-${KUBEVIRT_VERSION}-linux-amd64

chmod +x virtctl

Now everything is ready to continue and launch a VM.