Roman Mohr & Fabian Deutsch, Red Hat, KVM Forum, 2017
Fedora user and former package maintainer
oVirt and KubeVirt Contributor
Working at Red Hat
oVirt and KubeVirt Contributor
Working at Red Hat
(drome, CC BY-NC 2.0)
(davehamster, CC BY 2.0)
"Versatile, scalable, hyped, community driven, devops, …"
Take this with a grain of salt.
(colinwarren, CC BY-NC 2.0)
Technology? Features? Feeling? Tools? Requirements?
Yes
No
Replace?
If workloads can be moved to containers, then it's a migration
If not, then we still want convergence
Yes
No
Replace?
Yes
Replace?
No
Management Plane
Storage
Network
…
Virtual Machines
Management Plane
Storage
Network
…
Containers
Virtualization
and
containers
(giphy)
on the same infrastructure.
Management Plane
Storage
Network
…
Virtual Machines
Containers
Management Plane
Storage
Network
…
Virtual Machines
Containers
Management Plane
Storage
Network
…
Virtual Machines
Containers
Tell me more.
(giphy)
Kubernetes
Storage
Network
…
Virtual Machines
Containers
Kubernetes
Storage
Network
…
Virtual Machines
Containers
+ KubeVirt
“Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.” *
* https://kubernetes.io/
kind: Pod
metadata:
name: nginx
labels:
name: nginx
spec:
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
nodeSelector:
cpu: fast
status:
phase: Running
“A pod (as in a pod of whales or pea pod) is a group of one or more containers (such as Docker containers), with shared storage/network, and a specification for how to run the containers.” *
* https://kubernetes.io/docs/concepts/workloads/pods/pod/#what-is-a-pod
(source)
kind: VirtualMachine
metadata:
name: testvm
spec:
domain:
devices:
type: PersistentVolumeClaim
device: disk
source:
name: myVolumeClaim
nodeSelector:
cpu: fast
status:
phase: Running
We have the typical Pod like structure:
Metadata section
Specification section
Typical Pod features like
nodeSelector
affinity
Status section
Behind the scene a Pod is created, scheduled and we make sure that the VM starts correctly inside.
kind: VirtualMachine
metadata:
name: testvm
spec:
domain:
devices:
graphics:
- type: spice
consoles:
- type: pty
Typical Pod commands:
$ kubectl create -f mypodspec.yaml
$ kubectl delete mypod
$ kubectl exec mypod -it /bin/bash
$ kubectl create -f myvmspec.yaml
$ kubectl delete testvm
$ kubectl plugin virt console testvm
$ kubectl plugin virt spice testvm
Typical VirtualMachine commands:
kind: Migration
metadata:
generateName: my-migration
spec:
nodeSelector:
kubevirt.io/hostname: node1
selector:
name: testvm
status:
phase: Succeeded
Backed by a controller:
On object create, schedules a new Pod
On successful Pod start, it triggers the migration
At the end of the migration the object is moved to a final state
Always one VirtualMachine object you reference
The objects Migration with VirtualMachine provide a consistent entry point to anything VirtualMachine related, like the Pod does for Kubernetes.
Properly integrate the VirtualMachine lifecycle in a Pod lifecycle.
$ minikube start --vm-driver kvm --network-plugin cni
$ git clone https://github.com/kubevirt/demo.git
$ cd demo
$ bash run-demo.sh
$ bash run-demo.sh
# Deploying KubeVirt
...
vm "testvm" created
Waiting for KubeVirt to be ready ...
Waiting for KubeVirt to be ready ...
Waiting for KubeVirt to be ready ...
# KubeVirt is now ready. Try:
# $ kubectl get vms
$ kubectl get vms
NAME KIND
testvm VM.v1alpha1.kubevirt.io
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
haproxy-723816479-wcblm 1/1 Running 1 49s
iscsi-demo-target-tgtd-1270025779-nckbh 1/1 Running 0 48s
libvirt-8zj1k 2/2 Running 0 48s
spice-proxy-3525077118-fswn9 1/1 Running 0 47s
virt-api-1956313626-t9rhj 1/1 Running 0 46s
virt-controller-2251532855-tfm9f 1/1 Running 0 45s
virt-handler-s7g76 1/1 Running 0 43s
virt-launcher-testvm-----q05vh 1/1 Running 0 38s
virt-manifest-1665692876-cs8wp 2/2 Running 0 42s
$ kubectl exec -it libvirt-8zj1k bash
Defaulting container name to libvirtd.
Use 'kubectl describe pod/libvirt-8zj1k' to see all of the containers in this pod.
# virsh list
Id Name State
----------------------------------------------------
1 default_testvm running
# exit
Add-On
Stabilize
Contribute to Kubernetes
(cuatrok, CC BY SA 2.0)
WIP and R&D
Unified API
Converged infrastructure
Thank you.
libvirt, … everything in pods
New resource type for VMs
Operator pattern to manage VMs
VMs live inside pods
Native Kubernetes add-on
API server with VM functionality
Declarative, like everything else
Kubernetes' infrastructure is leveraged
⇝
⇝
⇝
⇝
(tabor-roeder, CC BY 2.0)