3

Assuming that a solution requires a mix of about 70% components running in containers, and 30% (legacy, monoliths, many dependencies, too hard/too expensive to containerize) in VMs, is there a way to manage the VMs via kubevirt when everything is deployed on GKE (well the containers certainly are, while the VMs are on GCP computes, ideally in same availability zone as where the GKE worker nodes are).

The key reason for wanting to use Kubevirt is to be able to treat all resources as K8s resources and orchestrated using K8s.

Is there a way to make this work on GKE, where as a user one is operating within constraints of a managed K8s CaaS ? Any pointers or guidance in this regard would be very helpful.

bdutta74
  • 163
  • 1
  • 7

1 Answers1

4

KubeVirt relies on nested virtualization. In addition to enabling virt instructions at the BIOS level of physical servers, guests need to load their kvm_intel (or kvm_adm) module with special options.

This feature is planned [1], though it's been for a while and I don't see anything that would suggest it's going to be implemented any time soon

Now, GCE does offer such an option [2]. If you really need KubeVirt, you may look into deploying your own Kubernetes cluster on top of GCE, without going through GKE.

SYN
  • 1,751
  • 8
  • 14
  • Thanks @SYN. I had indeed read that KubeVirt relied on nested virtualization when used on Minikube or Kind, but for production deployments isn't it so that KubeVirt could allow Kubernetes to orchestrate VMs on baremetals as well ? At least, that is roughly what I remember reading about Kubevirt when I came across it about a year back. From Google cloud standpoint then, it might simply mean getting a GCE compute node implement the Kubevirt agents (just a conjecture of how K8s would manage a VM like a pod). Or I might have been mistaken. – bdutta74 Aug 13 '21 at 17:34
  • 1
    KubeVirt relies on nested virtualization whenever your Kubernetes cluster/kubelet agent are running from a virtual machine - as GCE/GKE, qemu/kvm, ... Otherwise, you would only need to enable virtualization instructions in your BIOS. – SYN Aug 13 '21 at 18:24
  • 1
    As to "how would k8s manage a VM like a pod": the kubevirt controller would schedule Pods based on your VirtualMachines, with a container image that runs qemu/kvm, starting a guest into your Pod, setting up the plumbing: SDN, volume attachments, ... A kubevirt daemonset would tell kube-scheduler which of your nodes are eligible (can use virt instructions). If you can register GCE compute notes to your GKE cluster (is this doable ?), go ahead. May be easier to configure the OS / kvm module loading options – SYN Aug 13 '21 at 18:28