An In­tro­duc­tion to Kube­virt, the Ku­ber­netes Vir­tu­al­i­sa­tion Op­er­a­tor

Kube­virt is a Ku­ber­netes add-on that en­ables the man­age­ment of lib­virt vir­tual ma­chines. It is a tool that is used to sched­ule and man­age vir­tual ma­chines on a Ku­ber­netes clus­ter.

OpenSource For You - - Contents - Ref­er­ences [1]­virt/kube­virt [2] https://ki­wi­­virt [3]­rum/#!fo­rum/kube­virt-dev By: Swap­nil Kulka­rni The au­thor is an open source en­thu­si­ast with ex­pe­ri­ence in blockchai

With the ever grow­ing adop­tion of con­tain­ers in core de­ploy­ment prac­tices, the ease of port­ing ap­pli­ca­tions be­comes im­por­tant. Ku­ber­netes is be­com­ing a front-run­ner in the con­tainer­ised de­ploy­ment frame­work with its fea­ture set and awe­some com­mu­nity sup­port. In case the ap­pli­ca­tion can­not be con­tainer­ised, we still should be able to use com­mon frame­works to man­age dif­fer­ent work­loads. An op­er­a­tor is a method of pack­ag­ing, de­ploy­ing and man­ag­ing a Ku­ber­netes ap­pli­ca­tion, which is any­thing that is both de­ployed on Ku­ber­netes and man­aged us­ing the Ku­ber­netes APIs and kubectl tool­ing. You can think of an op­er­a­tor as the run­time that man­ages this type of ap­pli­ca­tion on Ku­ber­netes.

The Op­er­a­tor Frame­work is an open source project that pro­vides de­vel­oper and run­time Ku­ber­netes tools, en­abling you to ac­cel­er­ate the de­vel­op­ment of an op­er­a­tor. This frame­work in­cludes the fol­low­ing:

The Op­er­a­tor SDK: This is to build op­er­a­tors based on their ex­per­tise, with­out re­quir­ing any knowl­edge of Ku­ber­netes API com­plex­i­ties. It pro­vides the tools to build, test and pack­age op­er­a­tors. Ini­tially, the SDK fa­cil­i­tates the mar­riage of an ap­pli­ca­tion’s busi­ness logic, e.g., how to scale, up­grade, or back up with the Ku­ber­netes API to ex­e­cute those op­er­a­tions.

The Op­er­a­tor Life­cy­cle Man­ager: This over­sees in­stal­la­tion and up­dates as well as man­ages the life cy­cle of all the op­er­a­tors (and their as­so­ci­ated ser­vices) run­ning across a Ku­ber­netes clus­ter. The Op­er­a­tor Life­cy­cle Man­ager is the back­plane that fa­cil­i­tates the man­age­ment of op­er­a­tors on a Ku­ber­netes clus­ter. With it, ad­min­is­tra­tors can con­trol what op­er­a­tors are avail­able in par­tic­u­lar names­paces and who can in­ter­act with the run­ning op­er­a­tors.

Op­er­a­tor me­ter­ing: This en­ables us­age re­port­ing for op­er­a­tors that pro­vide spe­cialised ser­vices.

In­tro­duc­ing Kube­virt

Kube­virt has been de­vel­oped as a vir­tual ma­chine man­age­ment add-on for Ku­ber­netes, to ad­dress the need of de­vel­op­ment teams to adopt Ku­ber­netes with ex­ist­ing vir­tual ma­chine-based work­loads that can­not be eas­ily con­tainer­ised. It pro­vides a uni­fied de­vel­op­ment plat­form whereby de­vel­op­ers can build, mod­ify and de­ploy ap­pli­ca­tions re­sid­ing in both ap­pli­ca­tion con­tain­ers as well as vir­tual ma­chines, in a com­mon, shared en­vi­ron­ment.

Kube­virt ex­tends Ku­ber­netes by adding vir­tu­al­i­sa­tion re­source types (es­pe­cially of the VM type) through the Ku­ber­netes Cus­tom Re­source Def­i­ni­tions API. It pro­vides the abil­ity to man­age ad­di­tional re­sources along­side the re­sources pro­vided by Ku­ber­netes, by de­fault. But the re­sources them­selves are not enough to launch vir­tual ma­chines; so, in­stead, the func­tion­al­ity and busi­ness logic is added to the clus­ter by run­ning ad­di­tional con­trollers and agents on an ex­ist­ing clus­ter.

The ar­chi­tec­ture of Kube­virt

Kube­virt is built us­ing a ser­vice-ori­ented ar­chi­tec­ture and a chore­og­ra­phy pat­tern. It pro­vides ad­di­tional func­tion­al­ity to your Ku­ber­netes clus­ter to per­form vir­tual ma­chine man­age­ment. You may be aware of how pods are cre­ated in Ku­ber­netes from spec­i­fi­ca­tions, and how con­trollers per­form the nec­es­sary ac­tions to make the pod alive to match the re­quired state. Kube­virt uses sim­i­lar mech­a­nisms with ad­di­tional types added to the Ku­ber­netes API, ad­di­tional con­trollers for busi­ness logic and ad­di­tional dae­mons for node-spe­cific logic. Fig­ure 1 il­lus­trates the ini­tial ar­chi­tec­ture of Kube­virt with its ad­di­tional con­trollers, dae­mons and their com­mu­ni­ca­tion.

Kube­virt is de­ployed on top of a Ku­ber­netes clus­ter, which al­lows users to run Ku­ber­netes-na­tive work­loads next to the VMs man­aged through Kube­virt.

Com­po­nents of Kube­virt

Kube­virt con­sists of a set of ser­vices as de­scribed in the ar­chi­tec­ture given be­low.

virt-api-server serves as the en­try point for all vir­tu­al­i­sa­tion re­lated flows and takes care to up­date the vir­tu­al­i­sa­tion re­lated cus­tom re­source def­i­ni­tion (CRD). It also acts as the main en­try point to Kube­virt, and is re­spon­si­ble for the de­fault­ing and val­i­da­tion of the pro­vided VMs.

virt-con­troller pro­vides all the clus­ter-wide vir­tu­al­i­sa­tion func­tion­al­ity. It is re­spon­si­ble for mon­i­tor­ing the VM (CRDs) and man­ag­ing the as­so­ci­ated pods. The virt-con­troller is re­spon­si­ble for cre­at­ing and man­ag­ing the life cy­cle of the pods as­so­ci­ated to the VM ob­jects.

virt-han­dler is a Ku­ber­netes Dae­monSet needed on every host in the clus­ter. It per­forms func­tions sim­i­lar to those of Kubelet, where it is re­ac­tive and watch­ing out for changes in the VM ob­ject. Once changes are de­tected, it will per­form all the nec­es­sary op­er­a­tions to change a VM to meet the re­quired state.

virt-launcher is re­spon­si­ble for pro­vid­ing the cgroups and names­paces, which will be used to host the VM process. virt-han­dler sig­nals virt-launcher to start a VM by pass­ing the VM’s CRD ob­ject to virt-launcher.

lib­virtd in­stance is present in every VM Pod. virt­launcher uses lib­virtd to man­age the life cy­cle of the VM process.

Sim­i­lar to Ku­ber­netes, Kube­virt also has sup­port for pro­vid­ing ad­di­tional func­tion­al­ity for stor­age and net­work­ing, with ad­di­tional con­trollers and/or plu­g­ins.

Kube­virt com­mu­nity

Kube­virt is a work in progress. The code base is hosted on GitHub and is dis­trib­uted un­der the Apache Li­cense, ver­sion 2.0. The con­trib­u­tors hang out on IRC at #Kube­virt at FreeNode. You can join the Kube­virt-dev Google Group for de­vel­oper dis­cus­sions.

Fig­ure 1: Kube­virt ar­chi­tec­ture

Newspapers in English

Newspapers from India

© PressReader. All rights reserved.