Slide 1

Slide 1 text

Virtual Machine Management on Kubernetes Kunal Kushwaha

Slide 2

Slide 2 text

VM Platform oVirt/VMWare ESX/OpenStack/Cloud app-1 app-2 app-N VM Platform oVirt/VMWare ESX/OpenStack/Cloud app-1 app-2 kernel app-N app-1 app-2 app- M Current Situation in Enterprise Existing Products New Products Fragmentation VM VM VM

Slide 3

Slide 3 text

Why still use Virtual Machine? - Learning and planning for migrating existing Applications to Containers - Migration also means cost. - Not only requires Ops team but development team too. (complete software cycle) - Not all applications can be Containerized - Application designed for custom kernel? - Needs specific kernel parameters. - Lack of knowledge / Too complex to migrate in containers. - Application towards end of life.

Slide 4

Slide 4 text

So what we want? ● Run VM and containers in same platform i.e. Kubernetes ● Let containers and VM interact as any kubernetes pods do. ● Yet let VM to behave as VM, not application containers. VM Platform oVirt/VMWare ESX/OpenStack/Cloud app-1 app-2 app-N app-1 app-2 kernel app-N app-1 app-2 app- M

Slide 5

Slide 5 text

How to run VM in Kubernetes? - Kata Containers? - Runs application containers with VM level isolation. - Essentially runs VM as container - We need VM to run as VM, not containers ! KubeVirt

Slide 6

Slide 6 text

KubeVirt - Enables to run VM along with containers on Kubernetes. - Implemented as CRD (Custom Resource Definition) - Can be installed on existing Kubernetes cluster. - VM’s live in Pod (Transparent to monitoring API’s) - Uses kvm, qemu, libvirt runtime stack to run VM. - VM’s can interact with pods in cluster. - Helps in easy migration of existing applications. - Helps in Lift and Shift approach KubeVirt

Slide 7

Slide 7 text

Control Flow & Architecture API Server Virt Controller Kubelet Virt handler app-1 POD app-2 POD app-3 Kube Master Kube Node(s)

Slide 8

Slide 8 text

How to interact? - Kubectl - KubeVirt Objects - VirtualMachine & VirtualMachineInstance - Management of VM & VMI objects - Virtctl - Interaction with VM’s - Accessing console, VNC - Creating services to access VM ports - GUI - Overall Management. - https://github.com/kubevirt/web-ui

Slide 9

Slide 9 text

Example YML --- apiVersion: kubevirt.io/v1alpha3 kind: VirtualMachineInstance metadata: labels: special: vmi-fedora name: vmi-fedora spec: domain: devices: disks: - disk: bus: virtio name: containerdisk - disk: bus: virtio name: cloudinitdisk machine: type: "" resources: requests: memory: 1024M terminationGracePeriodSeconds: 0 volumes: - containerDisk: image: kubevirt/fedora-cloud-container-disk-demo:devel name: containerdisk - cloudInitNoCloud: userData: |- #cloud-config password: fedora chpasswd: { expire: False } name: cloudinitdisk

Slide 10

Slide 10 text

Important Commands ● Create a virtual machine instance. $ Kubectl apply -f fedora.yaml ● Get list of all virtual machine instance $ kubectl get vmi ● Describe instance of virtual machine instance $ kubectl describe vmi vm-fedora ● Create services and expose ports. $ virtctl expose vmi vm-fedora --name ● Like exec for containers. $ virtctl console vm-fedora ● Access GUI of Virtual machine $ virtctl vnc vm-fedora

Slide 11

Slide 11 text

Key Points - Networking - Backend: Expose to actual networking infrastructure in cluster - Pod, Multus & Genie (CNI plugins supporting dozen of solutions) - Frontend: VM networking. - Bridge, NAT, Slirp & SR-IOV - Storage (Disks & Volume) - Disk types - LUN (iSCSI),disk, floppy, CD Rom - Volumes - Temporary(VM life cycle) & persistent volume both are supported - Virtio drivers for Microsoft Windows - Supports Live Migration - Probes for health check and monitoring.

Slide 12

Slide 12 text

Under Active Development https://kubevirt.io/ Github: https://github.com/kubevirt/kubevirt Try on Minikube: http://kubevirt.io/get_kubevirt/

Slide 13

Slide 13 text

Thanks ありがとう