Git Product home page Git Product logo

vmctl's Introduction

Build Status Docker Repository on Quay

Overview

Technically: Controlling KubeVirt VMs from a pod

Logically: Ability to leverge Kubernetes workload controllers with KubeVirt VMs

asciicast

Idea

Let a pod control a VM - not directly (as in creating a qemu process), but indirectly by talking to KubeVirt.

The vmctl pod works with Virtual Machines (previousl offline virtual machines).

Notes

  • The pod only acts as a "remote control" to start and stop virtual machine instances
  • The pod can be simple
  • All VM configurations are done on the corresponding virtual machine

Try

Overview

  1. Deploy KubeVirt demo on minikube
  2. Deploy deployment.yaml
  3. Scale the deployment up

Step by step

Deploy the KubeVirt demo

Follow this guide to setup the base demo:

https://github.com/kubevirt/demo

Create deployment

$ kubectl apply \
  -f https://raw.githubusercontent.com/fabiand/vmctl/master/manifests/deployment.yaml

$ kubectl get deployments
NAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
vmctl     0         0         0            0           3s

Scale the deployment

Now you are ready to scale the deployment, and indirectly the number of VMs:

$ kubectl scale --replicas=1 deployment/vmctl
deployment.extensions "vmctl" scaled

This is just like scaling any other deployment.

You can now check that the scaling really happened:

$ kubectl get deployments
NAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
vmctl     1         1         1            1           3m

And you can also look at the VM instances in to see that really VMs were spawned:

$ kubectl get pods,vms
NAME                         READY     STATUS    RESTARTS   AGE
virt-launcher-testvm-j7f8k   2/2       Running   0          39m
vmctl-58ff778cc4-wskgs       1/1       Running   0          23s

NAME                            AGE
testvm                          39m
testvm-vmctl-58ff778cc4-wskgs   20s

Scaling down just works as expected:

$ kubectl scale --replicas=0 deployment/vmctl
deployment.extensions "vmctl" scaled

$ kubectl get deployments
NAME      DESIRED   CURRENT   UP-TO-DATE   AVAILABLE   AGE
vmctl     0         0         0            0           3h

$ kubectl get pods,vms
NAME                         READY     STATUS        RESTARTS   AGE
virt-launcher-testvm-j7f8k   2/2       Running       0          41m

NAME      AGE
testvm    41m

And the instance is gone again.

Note: One VM will always be defined, as it act's as the prototype for the VMs any vmctl pod is creating.

vmctl's People

Contributors

fabiand avatar stu-gott avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.