[Music]
okay we're next up we've got shri jeff
anogen he's talking about vms and
containers a reminder if you have
questions put them in the to the
question tab and vinulus okay
thanks simon hey thanks everyone for
joining in good evening good afternoon
good morning
so this is about uh
how virtual machines and containers can
actually be
used in a single control plane or
management plane the
topic of this session is vms plus
containers equal to the perfect wedding
as you probably see in my slide i am
srijit anderson working for red hat
and over the next uh 25 minutes i'll be
speaking about cube word
and we'll be demonstrating some of the
keyboard functionalities using
red hat's
uh open shift virtualization tool
and i'm sure that those who joined this
might have heard about keyboard or
kubernetes
or has enough experience on
virtualization technologies so what
exactly is keyboard right uh so keyboard
is nothing but
uh comparing the power of kubernetes to
manage your virtualization
infrastructure okay
so i'll speak about more on cubot in the
coming slides and in the demonstration
and
as you know right uh containers has been
there for the last couple of decades
we started with
the solaris zones then we had the lxc
linux containers and in
in 2012 we had
docker coming in as a container runtime
and popularizing containers but you all
know that containers are not vms or
virtual machines right
containers
by the way
has a lot of commonalities with virtual
machines
on how it does the resource allocation
uh how it actually
do security
and uh
how it actually
does the
compartmentalization of resources within
your
systems right so containers make use of
lot of linux capabilities like linux
kernel namespaces control groups
and network namespaces right and the
main difference is containers use a
container image which only has
suggestion of os with the application
binaries and the dependencies
so they are not virtual machines they do
not have guest oils and additional
virtual devices and all those layers
which you otherwise see in a traditional
virtualization
now speaking about cube word
we are actually going to try putting
virtual machines inside of a container
okay
so uh if you have experience with kvm
which is a kernel based virtual machine
kvm is nothing but a
linux kernel
module right when you start a virtual
machine it is nothing but a process
running in that linux kernel right and
containers also encapsulate processes
right so if you look at the
commonalities they have
the same underlying resource needs like
accessing cpu memory network
and most of the times storage from the
host or from your shared storage right
so you can indeed
use containers to spin up virtual
machines or have containers running
virtual machines
now
virtual machines running in containers
are nothing but what we talk about
keyboard okay
uh we use the kbm hypervisor
as a virtualization technique or tool
and the most important fact is
uh everything is managed by kubernetes
so most of you would know kubernetes is
nothing but the container orchestration
and cluster manager developed by google
and obviously it is a community open
source uh solution right
so the benefit of using kubernetes to
manage virtual machines then you only
have one single management plane or
control plane
to not only manage your containerized
workloads but also the traditional
uh non-containerized workloads which are
running in virtual machines
and from a technical standpoint you have
the same uh port like software defined
network connectivity uh you can also
configure uh vlans uh to actually use
the existing external vlan
configurations which are already
provisioned in your network and all
those uh terminologies and paradigms
which you are familiar with in
kubernetes like persistent volumes
persistent volume claim storage class
everything could be
made available within the virtualization
space
now
uh
i
mentioned about openshift virtualization
which is what i'm going to use for the
demonstration
openshift virtualization is basically
the commercial version of
uh cubot from red hat it is part of our
openshift container platform and it also
uses kb right and you know kvm actually
is there from
uh more than a decade right there are a
lot of production use cases and
successful customer stories around
kvm based products and solutions right
so kvm
uh
cavemu and libod are basically the
tourings which we use within keyboard to
create and manage virtual machines with
keyboard
and obviously the abstraction layer
continues to be the same which is the
lip boot so in this you see you have the
uh it could be your
data center hardware or managed services
provided provider hardware you have
cpu memory storage and network on top of
that you deploy a linux operating system
running kvm
then abstracts uh the resources using
liquid right then you create vms so this
is how
uh kvm
architecture looks like
now coming to kubernetes right uh how
does virtual machines in a container
world look like okay
so you use the same physical hardware
which you use in the traditional
virtualization
and on top of that you install a
container host
a classical example of a container host
is core os
and then use the kubernetes
container of construction layer on top
of it
and interestingly along with the
standard
containerized applications running as a
port
you can also have a virtual machine
running as a port
okay and it integrates directly into
your existing kubernetes clusters
that means
you are a
container networking interface or cni
container storage interface and the
kubernetes operator framework
using custom resource definitions all of
those could be leveraged okay
and everything which kubernetes does
could be
translated into the virtual machine
world or the virtualization world okay
and uh
the good thing about using kubernetes
and virtualization together it is
virtualization is a native to kubernetes
so when you say native to kubernetes
all of these virtual machine based
objects
are objects within kubernetes so to say
you have a virtual machine object
virtual machine instance virtual machine
instance migration data volume and all
those
so quickly if i come back to my console
i hope you can see my console
i'll just show you some of the cute ctl
commands so if i do cube ctl get vms
you'll see the virtual machines which
are configured in my demo environment if
i do virtual machine instances of vmis
you see the virtual machines which are
actually up and running right you see
there is a fedora 35 virtual machine
running in this kubernetes cluster
using the ip address 10 9 1 21 right so
all of these resources are native to
kubernetes right so it is a native
virtualization within kubernetes to
manage virtualization
now moving ahead
uh
how does that uh look like from a
architectural perspective right
so you have the storage network cpu
memory and device
uh
required for containers as well as
virtual machines right
so for each virtual machine which you
are uh configuring it will create a
separate board okay every vm runs in a
launcher port
and that launcher pod would actually
supervise
the board integration with other
containers which are running in your
kubernetes
and that launcher port can also be used
to
connect and check your virtual machine
details using the traditional wash
commands if you wish okay
and uh you know bleepwater and gmo are
available in every linux's whether it is
the enterprise linux from red hat or
fedora or central stream right and it
has very minimal overload
and from a security perspective we use
ac linux security enhanced linux with
multi-category security
so to provide complete isolation
between virtual machines
other containers and
having the same security across
different
tenants running on the same kubernetes
and how do you use vms and containers
together right so i talked about uh
having the same control plane and
management between via kubernetes
so everything which you give to
a
standard container like a service id
if you're familiar with openshift you
can give external access using a route
object
and the kubernetes has the ingress right
all of this could be configured to a vm
as well
and interestingly you can use the same
software-defined networking plug-ins and
use the pod network which is available
in kubernetes
to be given to the virtual machines
right
and also the all network policies which
you configure in kubernetes can also be
applied to the wheels because they use
the same port network right
so the vm to board
and
both to different vms and different
name spaces all of those actually
happens over the software-defined
networking
uh based on whether you
configure external access to the vms or
ports right so the good thing is it is
native to kubernetes
but at the same time you have the
flexibility of running your traditional
workloads which require a virtual
machine level access maybe a database
like mysql or oracle right or any other
uh
workloads which you think are not yet
ready to be containerized okay
so like i said it's completely managed
with kubernetes so what i do is i will
quickly move over to my demo
environment i believe you can see my
uh
environment here
just
improving the font size okay so this is
a open shift cluster which i'm using for
this demonstration
so if you're wondering what is open
shift open shift is nothing but the
commercial kubernetes enterprise version
from red hat okay
so
uh when i do oc version which will give
you the kubernetes version we are using
we are using version 1.19 for this demo
okay
and openshift version is four six
and many of you may not be familiar with
oc so i'm moving back to the popular
cube ctl or cube cuddle command
so i'm going to do cube cdl get
projects on namespace
okay you get to see the different
projects and namespaces
which are part of this openshift
environment and you would notice at the
end of the
listing there is a namespace or a
project which i created
in the name
srijith dash keyboard so i
moved to that project using the command
oc project it's regis dash keyboard
okay
so it's very similar to you using cube
ctl command but
i'm using oc because oc is a native
client for open shift so now when you do
oc get ports
you see there is a word launcher
uh
port which is up and running right and
it is up
it is up for more than two hours now
because i did a dry run before i started
my live session just to make sure that
democracy okay
so there is a word launcher port up and
running here okay
and
when you do oc get vms
i see a virtual machine which is
available
and vmi
there is that virtual machine which is
also running okay so how does it all uh
work so if you go to the ui and
connecting to the openshift ui here
uh you can deploy virtualization
uh
or keyboard via the operator framework
so if you go to the operator hub within
your
kubernetes cluster or in openshift
uh you can look at the
operators which are available
so look for virtualization
okay
so it shows up as open shift
virtualization when you use open shift
container platforms so you see here
openshift virtualization
you choose that and click on install and
it gets installed so that's how you add
the virtualization capabilities to your
existing kubernetes cluster
now remember one thing
uh you may all know for kvm to work
right
you need to have virtualization
capabilities available in your
underlying hardware okay so if you're
using a
intel based cpu it should have the
appropriate flags
for amt you have other flags so make
sure that your
hardware is compatible to run virtual
machines
so when you translate that to kubernetes
the kubernetes worker nodes or the
minions should have the virtualization
capabilities to create the vms okay
so that's when kvm can actually find the
correct worker nodes and schedule
virtual machines to be created okay
so those kvm related
technical requirements
uh are needed for keyboard as well okay
so once you have the operator deployed
under the installed operators you will
see that operator you see openshift
virtualization and it is now deployed in
namespace called as openshift.cnb
cnb expands to container native
virtualization
and that's how i deployed openshift
virtualization functionality within my
openshift cluster
once you have that done
you have the virtualization option
available under the workloads
okay
you see virtualization and you see an
option to create virtual machine
and it is very similar to uh how you
create a virtual machine in your
standard virtual environments whether
you're using
uh lib world or the command line
interface it follows the same pattern
right so if you click on create virtual
machine
you have the option of importing your
virtual machine definition or
create a new virtual machine using the
gui or the yammer
so i'm going with the wizard okay
uh i hope you can see my screen good
enough
uh you need to give the general details
like name of the vm operating system and
all those stuff
so uh give the name
indeed fedora
then operating system you need to choose
there are some operating systems which
are pre-listed based on the operating
system you choose it will use the
appropriate para virtualized devices
boot source you obviously need to
provide the boot source for your road
disk of the vm right so there are a
couple of options which are available if
you have a persistent volume claim
which is acting as a disc for your
virtual machine you can choose that or
if you want to download a virtual
machine image from your local
environment or from public uh place you
can click on url and give
that you are
so as part of the demonstration i'm
using a fedora cloud image so you see
fedora has cloud-based images
so you can download the cucu image for
fedora from here
copy this and then use that url
to use as a disk image okay over here so
you give that url
you give the flavor so flavor is like
your virtual machine instance
configuration like how much memory cpu
disk etc
and there is some workload profile which
you can use basis which
uh kvm will adjust some of the tuned d
profiles under the hood okay
so once you have that
you go to the next okay just need to
give some urls here so
let me paste it
so i just uh
think i added
a different urls if i keep the correct
url here
copy
yeah because uh keyboard requires
special hardware to
run
uh virtual machines right i'm using a
machine which is available within my
corporate network so that's why it is
inside a console
yeah so i choose a flavor
just to satisfy this yeah
tiny then
choose a workload profile whether it is
desktop or server hit next
then in the next options you give the
network interface so whether it is a
port network or whether you need to have
something called as multus so if you
heard about multis if you have multiple
interfaces
available in your workflow nodes you can
actually create bridges and then have
direct connectivity given to the virtual
machines if you wish
so i'm going ahead with the standard
port networking here
and then
storage you choose
so we have a root disk of 15 gb
so if you want to edit you can do that
and on the advanced tab you have the
option of giving cloud in it
parameters like whether you need to give
a sh key pair
to
do
access via ssh over to the vms
and then
finally you review and
deploy the vms okay so i already have
the vm deployed
i didn't take a chance to do it live
because
uh
it probably could take
more than 10 minutes right so what i did
was i already had the virtual machines
deployed like two hours ago
so that's the virtual machine which you
see here fedora 35
so
if you go to that virtual machine you
see all the details pertaining to the
virtual machine like
the console the network interfaces disks
everything so if i hit the console
you should be able to connect to the
console if you want to open it in a new
window you can do that as well okay
so you have the native way to connect
the console uh using the different
console options i'm using vnc here but
it also supports spies and
rtp
okay
now
uh what i did was i actually added a
service definition to this virtual
machine
so i believe most of you are familiar
with kubernetes services
so what i did was i created a service in
my project
to be associated to this new virtual
machine
so you see here there is a service in
the name fedora 35 service
and
if you look at the yaml definition of
that service
this is how it is
i'm using uh
the
uh not port
uh notepod is nothing but you expose a
port on your worker nodes
so that you can connect to that node
port and get
translated into the
vm port or the port port right so
i'm using notepod based service here and
associated that to the
virtual machine which is up and running
so the not port here is
31220 so if i need to connect to my
virtual machine
i can basically do an so search
so
uh
i use a fedora username which is a
default username for the fedora cloud
based image
and connecting to the port three one
double to zero okay and 190
192.168.50.12
is nothing but one of my worker nodes in
kubernetes so if i do cube cpl
get nodes
you see i
have three nodes
acting as both master and worker okay
so if i do
dash of white
you get to see the ip address here 192
168 50.10
11 and 12. so if i connect to
one of these worker nodes whether it is
10 11 or 12
uh to the port 31220 i will land
directly into the
virtual machine so this is my fedora
virtual machine so if you do fedora
release it's fedora 35 and latest one
uptime
up for more than two hours
uh so i've give 4gb ram and
one cpu here okay yeah
so this is a virtual machine which is up
and running
now other thing which i wanted to show
is if i do oc get ports you may remember
i had a word launcher port right
so if i need to connect to that port
i'm going to connect to the water
launcher port
and i'm going to
run it terminal
and now when i do
push list
see here so this is a virtual machine
which is actually running right so
remember what launcher port would
actually make sure that the virtual
machines are scheduled properly
uh it downloads the image from the url
and creates a persistent volume flame
and persistent volumes
as part of the broaching okay
so the virtual machine disks are
actually
running as persistent volumes and it is
requested via persistent volume flames
yeah so that was a quick demonstration
of uh how the virtual machine looked
like in a cube board or openshift
virtualization you can also use commands
like word ctl
to basically
simplify the virtual machine creation
rather than using the gui okay
so
i just wanted to close out by saying
[Music]
how does it
aligned with
uh the standard kubernetes environment
right so the virtual machines inherit
many functionalities from kubernetes
like cube scheduler
the high availability right if one of
the virtual machines
is not running properly
the cubelet would actually let
uh kubernetes aba know about that and it
can be
started fresh in a new uh
ma new worker node right so all the
benefits of cubelet and kubernetes you
are actually going to use within
uh keyboard right
uh so containerized vms have the same
characteristics as known containers like
you need to give the cpu memory
everything right you can also run linux
and windows guest operating systems
right
and like i said storage is provided by
both system volumes and the virtual
machine images are uh
provided by something called a cdi or
containerized data input okay
and like i said earlier it inherits
all the port networkings
now this is a
single slide which gives you the
convergence of
both
uh virtualization which you see with
overt to the left
and the traditional uh
private cloud with openstack right so
uh if you see cuboid sits in the middle
right you have
the cubelet uh
being used as the agent in kubernetes
running on the worker nodes but if you
look at overt or openstack for that
matter it will be the vdsm and the nova
compute
and the common element in all of this uh
three different architecture is the
libert
camus and kvm right
so if you can actually containerize that
component right it's nothing but
keyboard right
so that's basically the benefit of
having uh
a single converged control plane or
management interface
to run
the
standard
containerized workloads as well as your
virtualization workloads whether it is
database or any other
solutions which you think requires more
time to contain rise right
a
slightly more uh architectural overview
you see the cubelet running on nodes
you have the containers running as
sports you have the virtual machine also
created within a port using the
vote launcher right so you have your
master nodes running the api server and
all those okay
so how does the virtualization
capabilities get added to the kubernetes
api it's via the
custom resource definitions or the
operator framework okay so you extend
the kubernetes api to have the virtual
machines virtual machine instances and
all those
resources which
make up the virtual machine management
okay
so a single api to manage
all your workloads okay
so that's where i stop uh
that's my presentation i believe
we have
two minutes yep
yep um we have a couple of little
questions
for free okay uh i'll just go straight
into it
first question is can you
do things with the vms like deployments
like
deploy replicas do rolling updates
things like that
ideally yes uh when i say ideally yes
because it is managed within kubernetes
right you probably could extend uh
virtual machines similar to a port you
can use deployments or deployment
configs for that matter but again it's
easier said than done right rotting
deployments when you say you need to
you would have multiple replicas you
made for the virtual machines to be
scaled out
created wait for the os to come right
remember all the
uh time lapse which you see in the
traditional virtual environment still
exist in
kubernetes managed plane when you
think about vms right
but
your question yes you can do that yeah
so that's one of the benefits
okay uh next question
um our hypervisors other than kvm
supported um i.e firecracker
and no it's all again
okay
and the last question was can you have
multiple
vms behind the service
you say
i'm not sure whether i understood it but
i'm thinking uh multiple keyword vms
behind the server if you are thinking
about service
like kubernetes
uh you're meant to say multiple
kubernetes
control planes i would say no but
yeah that i think that requires more
clarity
okay
okay i think we're out of time we'll
have a chat
we can um go over that one in the chat
and they can clarify the question okay
all right thank you very much very much
richard thank you
thank you