Using Kubernetes to run containers and virtual machines.

Fabian Deutsch, Red Hat

containerdays.io, 2019

https://kubevirt.io

Fabian Deutsch

Fedora

oVirt

Kubernetes and KubeVirt ⇝ kubevirt.io

Working at Red Hat

 

@dummdida

fabiand

Why would you do that?

There are on-prem and public cloud solutions!

(drome, CC BY-NC 2.0)

(drome, CC BY-NC 2.0)

(davehamster, CC BY 2.0)

 

VM Platform

 

 

VM Workload

 

Metal

1 + 1 = 2

 

VM Platform

 

 

VM Workload

 

Metal

 

Container Platform

 

 

Container Workload

 

Metal

VM Platform

Storage

Network

 

VM Workload

 

Container Platform

 

Container Workload

 

 

VM Platform

 

 

VM Workload

 

Metal

 

Con. Platform

 

 

Con. Workload

 

Metal

    Logging, Metrics, Alerting, …

+ Scheduling, Network, Storage

+ Knowledge

    $$$.$$$,-

1 + 1 = 2

To

Converge the infrastructure

for

Containers & Virtual Machines

Kubernetes

Bare Metal

 

VM Workload

 

 

Container

 

Keep your VMs …

Bare Metal

Bare Metal

Kubernetes

 

VM Workload

 

 

Container Workload

 

Keep your VMs …

Bare Metal

Bare Metal

Bare Metal

Kubernetes

 

VM Workload

 

 

Container Workload

 

… transition what you need and stick to VMs as needed.

Bare Metal

Bare Metal

Bare Metal

To

Converge the Workflows & tools

for

Containers & Virtual Machines

$ kubectl edit pod …
$ kubectl edit vm …

 

One to rule them all.

Demo

(image source: giphy)

$ minikube start --vm-driver kvm

$ git clone \

        https://github.com/kubevirt/demo.git

$ cd demo

$

Try (with minikube)

apiVersion: kubevirt.io/v1alpha1
kind: VM
metadata:
  name: testvm
spec:
  domain:
    devices:
      graphics:
      - type: spice
      video:
      - type: qxl
      disks:
      - type: network
        snapshot: external
        device: disk
        driver:
          name: qemu
          type: raw
          cache: none
        source:
          host:
            name: iscsi-demo-target.default
            port: "3260"
          protocol: iscsi
          name: iqn.2017-01.io.kubevirt:sn.42/2
        target:
          dev: vda
      consoles:
      - type: pty
    memory:
      unit: MB
      value: 64
$ bash run-mini-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

  • Drop into any existing bare-metal cluster
  • kubectl to rule them all
  • Same resources for scheduling, storage, and network
  • No node configuration needed

(tabor-roeder, CC BY 2.0)

Simple

Let's stay in touch

Thank you.

Learn and contribute at https://kubevirt.io

Using Kubernetes to run containers and virtual machines

By Fabian Deutsch

Using Kubernetes to run containers and virtual machines

Learn about one way to run virtual machines on Kubernetes.

  • 887
Loading comments...

More from Fabian Deutsch