피드 구독

kubevirt-1

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.


저자 소개

UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Original series icon

오리지널 쇼

엔터프라이즈 기술 분야의 제작자와 리더가 전하는 흥미로운 스토리