Virtual machines have existed for a long time and have filled a critical role providing infrastructure on demand to application administrators and developer teams who need to be able to code, test and deploy faster than can be done with physical infrastructure. However, container technology--which isn’t new but has seen a rise in popularity in recent years--is poised to supplant virtualization as the preferred application deployment mechanism for many use cases.
Containers decouple the application from the operating system in the same way that virtualization decoupled the operating system from the hardware. They can allow for simplified separation of responsibilities between developers and system administrators, enabling each to focus on the components of the stack which they care most about. Container platforms, such as Red Hat’s OpenShift--an enterprise version of the popular Kubernetes platform--are designed to provide a suite of capabilities beyond simple application abstraction and deployment. A container orchestration platform enables the application team to define how the components of a cloud native application should be deployed, connected and scaled without having to worry about the details. Application deployments using containers, and container orchestrators, can reduce friction between the operations team and the application team by helping to remove requests for new and changed resources.
However, containers are not a perfect fit for all situations. Sometimes a virtual machine is needed by applications, or application components, to provide features such as kernel isolation, dedicated resources, or simply an environment which is supported by a third-party vendor. Maybe you’re ready to migrate your applications wholly to containers, but the applications still have components which must be virtualized? How do you get the benefits of a virtual machine and container together?
One answer: KubeVirt. KubeVirt is an open source project which enables virtual machines to be deployed, consumed, and managed by Kubernetes just like containers. Having a single deployment and management plane for both containers and virtual machines is designed to enable a unified platform for cloud-native applications, regardless of the requirements. For example, perhaps the application that you are developing is mostly composed of container-based microservices, but there’s that one nagging legacy service that can only run in a VM. With KubeVirt, you can have that VM run inside a container, managed by Kubernetes, along with the containers that host the other services/microservices.
From zero to VMs in three minutes
Getting started with KubeVirt can be simple, all you need is one of two things: a bare metal Kubernetes 1.10+ or OpenShift 3.10+ cluster. If you are wanting to just test functionality, you can also use emulation instead of virtualization for the virtual machines, just be aware of the performance impact.
We’ll be following the quick start guide from the documentation, be sure to read the full install documentation if you are curious about how to customize your deployment.
After identifying your cluster, deploy using the CLI:
# add permissions if using OpenShift
oc adm policy add-scc-to-user privileged -n kube-system -z kubevirt-privileged
oc adm policy add-scc-to-user privileged -n kube-system -z kubevirt-controller
oc adm policy add-scc-to-user privileged -n kube-system -z kubevirt-apiserver
# apply the KubeVirt configuration, adjust RELEASE for the current version
RELEASE=v0.11.0
kubectl apply -f https://github.com/kubevirt/kubevirt/releases/download/${RELEASE}/kubevirt.yaml
Ansible will deploy the components and example content, which you can explore using standard kubectl or oc commands. Before moving on, you’ll also want to deploy virtctl, the CLI tool for managing virtual machines, from GitHub.
To deploy a test virtual machine, a sample config file can be found in the kubevirt/demo project on GitHub. We can deploy with one command:
# use the oc command if deploying to OpenShift
kubectl create -f https://raw.githubusercontent.com/kubevirt/demo/master/manifests/vm.yaml
A newly created virtual machine starts in the powered off state, so to start it we will want to use virtctl. If you want to see the virtual machines in your cluster, use the command kubectl get vms.
# start the virtual machine
virtctl start testvm
The CirrOS based virtual machine image will be started on a node in the Kubernetes or OpenShift cluster. Viewing running virtual machines in the cluster can be done using the kubectl get vmi command, and you can connect to the console using the command virtctl console testvm, or if you have remote-viewer installed, connect via VNC using the command virtctl vnc testvm.
Containers AND virtual machines, not OR!
There are many ways to deploy applications and the best way is going to be different for every application. As an application team, choosing between virtualization and containerization often meant a trade off in convenience and speed to deploy, having to orchestrate across multiple platforms. KubeVirt combines both worlds, enabling Kubernetes to schedule, deploy, and manage virtual machines just like any other containerized workload.
If you believe that KubeVirt is a good fit for your application, please give it a try! Getting started is easy and we’ve only scratched the surface of the capabilities in this blog post. Subscribe to the mailing list, visit us on GitHub, check out our other blog post today, or contact us on Twitter for more information or help.
À propos de l'auteur
Contenu similaire
Parcourir par canal
Automatisation
Les dernières nouveautés en matière d'automatisation informatique pour les technologies, les équipes et les environnements
Intelligence artificielle
Actualité sur les plateformes qui permettent aux clients d'exécuter des charges de travail d'IA sur tout type d'environnement
Cloud hybride ouvert
Découvrez comment créer un avenir flexible grâce au cloud hybride
Sécurité
Les dernières actualités sur la façon dont nous réduisons les risques dans tous les environnements et technologies
Edge computing
Actualité sur les plateformes qui simplifient les opérations en périphérie
Infrastructure
Les dernières nouveautés sur la plateforme Linux d'entreprise leader au monde
Applications
À l’intérieur de nos solutions aux défis d’application les plus difficiles
Programmes originaux
Histoires passionnantes de créateurs et de leaders de technologies d'entreprise
Produits
- Red Hat Enterprise Linux
- Red Hat OpenShift
- Red Hat Ansible Automation Platform
- Services cloud
- Voir tous les produits
Outils
- Formation et certification
- Mon compte
- Assistance client
- Ressources développeurs
- Rechercher un partenaire
- Red Hat Ecosystem Catalog
- Calculateur de valeur Red Hat
- Documentation
Essayer, acheter et vendre
Communication
- Contacter le service commercial
- Contactez notre service clientèle
- Contacter le service de formation
- Réseaux sociaux
À propos de Red Hat
Premier éditeur mondial de solutions Open Source pour les entreprises, nous fournissons des technologies Linux, cloud, de conteneurs et Kubernetes. Nous proposons des solutions stables qui aident les entreprises à jongler avec les divers environnements et plateformes, du cœur du datacenter à la périphérie du réseau.
Sélectionner une langue
Red Hat legal and privacy links
- À propos de Red Hat
- Carrières
- Événements
- Bureaux
- Contacter Red Hat
- Lire le blog Red Hat
- Diversité, équité et inclusion
- Cool Stuff Store
- Red Hat Summit