0

I am trying to create a VM setup in my Kubernetes cluster using KubeVirt. I have two EC2 instances(Master node: t2.xlarge and worker node: m5.metal) in AWS cloud and I have setup the cluster using KubeAdm. The CNI used is Flannel.

I had setup KubeVirt (https://kubevirt.io/) in my Cluster to provision VMs along with pods in my cluster. KubeVirt is an open-source sandbox project from CNCF. I have setup KubeVirt and it's running fine. I followed the steps in this link to setup KubeVirt: https://kubevirt.io/quickstart_cloud/

After that, I wanted to spin up a VM in my Kubernetes cluster. So, I followed the official documentation from: https://kubevirt.io/labs/kubernetes/lab1.html which creates a VirtualMachineInstance using the image 'quay.io/kubevirt/cirros-container-disk-demo'.

The VM got created and is working fine. I tried to login to the VM using the command virtctl console --kubeconfig=$KUBECONFIG testvm. And, it seems that I cant use any package managers like apt-get, yum, akp,etc. So I am finding it hart to use as a practical VM.

So, my question is whether we can create container-disk images? Also, I want to run a Python-Django based application in that VM. So, is it possible to create a container-disk image based on Ubuntu and run it as a VirtualMachineInstance in a Kubernetes cluster using KubeVirt? What are the full steps?

arjunbnair
  • 25
  • 1
  • 2
  • 8

1 Answers1

0

I have the same question. I did find some explanation for the default (test) container disk you are referring to in https://github.com/kubevirt/kubevirt/blob/main/containerimages/container-disk-images.md.

  • I found out that first you need to download a cloud image from any Distro in the format of .qcow2 and then write a docker file and create an image. Then after that step, you can push it to the container registry and then use it in the future. But the thing is that, I tried with Centos 7 (Core), The VMI gets booted up in the K8s cluster and asks for credentials which I dont actually have. I was expecting some generic default password and username that I could try. But it didnt work. – arjunbnair Aug 09 '22 at 18:44
  • I found the cloud image from this site: https://cloud.centos.org/centos/7/images/ . And You can refer the dockerfile from here: https://kubevirt.io/user-guide/virtual_machines/disks_and_volumes/#containerdisk . Please add some more info if you find the solution. I cant login to my booted VM right now, that's the issue that I am facing now. – arjunbnair Aug 09 '22 at 18:44
  • I will post the answer if I find it myself. :) – arjunbnair Aug 09 '22 at 18:44