-
>> Hi. I'm Chris Mutchler,
-
Principal Enterprise
Architect and
-
VCDX 257 from
virtualelephant.com.
-
And in this video,
we're going to
-
once again deep dive
into the world of
-
Rancher and show
you how you can
-
leverage it as
a management
-
tool for deploying,
-
configuring and operating
-
Kubernetes
clusters at scale.
-
Let's get started.
-
[MUSIC]
-
In this video,
-
we were going to deep dive
-
into Rancher once again.
-
Back in 2023, I
-
recorded my first
video on Rancher
-
showing you how you
could deploy Kubernetes
-
clusters inside of a
vSphere environment,
-
leveraging the Rancher
management tool.
-
Now, since that time,
it's become one
-
of my top viewed
videos on the channel,
-
and I thought
it was time for
-
an update for 2024.
-
One of the strengths
of Rancher
-
as a management tool is
-
its capability to be able to
deploy Kubernetes clusters
-
across a myriad of
environment types.
-
From vSphere environments,
-
which I'll show you
-
once again in this
video to Azure,
-
AWS, GCE, and several
other Cloud providers,
-
Rancher can become that
-
single management tool
-
for all of your
Kubernetes clusters,
-
thus allowing you to
be able to create
-
an enterprise grade
service offering
-
for Kubernetes
based on Rancher.
-
One of the things
that I appreciate
-
most about Rancher
-
is its simplicity and
ease of operations.
-
Anyone can get a
Rancher management tool
-
running up in their
environment in
-
just a few moments
once they have
-
a machine or operating
-
system available to them,
-
and its ability to almost
-
instantaneously
begin deploying
-
Kubernetes clusters
makes it one of
-
the easiest
management tools
-
out there to be
able to configure,
-
install, and
then manage from
-
an SRE or operations
perspective.
-
So let's dive
right into the UI.
-
Let me show you what's
changed and how
-
I began leveraging Rancher
-
once again with these
updates to be able to
-
deploy clusters within
-
a lab environment
very easily.
-
Once you've got
-
the Rancher docker
image running,
-
and I have it running
here inside of
-
a virtual machine
that I've
-
deployed inside of
my VCR environment,
-
and I've actually created
-
a persistent volume or
-
static storage for
the docker container
-
to be able to survive
after reboots,
-
the first thing
that you'll see in
-
the UI screen here is
-
instructions on how to get
-
the boot password from
the container itself.
-
Now once you've done that,
-
you can copy the password
-
straight into the UI here,
-
and then once
you've done that,
-
it will prompt you to
change the password
-
or accept one that they
-
randomly generate for you.
-
And once you've
done that, it
-
will log you straight into
-
the main dashboard
or UI of Rancher.
-
The first thing that you
-
want to do is actually
-
click on the menu and
-
select Cluster Management.
-
And from there, you want
-
to select Cloud
Credentials.
-
Now you can see you
-
have multiple
options here.
-
I'm going to go
ahead and create
-
a VSR credential
that points
-
to my vCenter Server that
-
I have running in the lab.
-
I'm going to specify
the URL for vCenter.
-
I'm going to make
sure that I tell it
-
Port 443 and then
I'm going to
-
enter the username and
password information
-
for that vCenter Server.
-
Once that's done, we're
-
actually ready to start to
-
pulling a cluster of
Kubernetes via Rancher.
-
So once we get back to
-
the cluster
management screen,
-
we can go ahead
and click Create.
-
This new cluster create
screen is one of
-
the key differences
between
-
the old version of
-
Rancher and the
new version.
-
You can see here that
-
before we had to create
some templates to
-
use specifically to point
-
to certain pieces of
information that were
-
relevant to our
vSphere environment
-
for an RKE cluster
to be deployed.
-
In this new version
of Rancher,
-
you no longer
have to do that.
-
And so you can
go ahead and
-
click Create, come
to this screen,
-
and you can see that
it's prepopulated with
-
some information
that is specific
-
to deploying Kubernetes
-
in a vSphere environment.
-
So as you would
typically expect,
-
you can give it
a cluster name,
-
you can give it
a description.
-
And then from
there, you can
-
see that it's created
-
this default pool
and this pool is
-
going to be a set
of virtual machines
-
that it's going to create.
-
And you can see the
default actually selects
-
SCT control plane as
well as worker nodes.
-
Now we're going to want to
-
separate out the control
-
plane from the data plane,
-
and so we're
going to unselect
-
the worker for this pool.
-
We're going to give
it a different name
-
and then we're going
to go through and
-
specify some information
-
specific to how I want
-
the controllers
to be deployed
-
for Kubernetes within
my own environment.
-
Now one of the
key things that
-
I've done prior
to getting to
-
this screen is
that I've already
-
downloaded an Ubuntu
Cloud Image OVA
-
and I've imported
that OVA into
-
my vCenter Server and
-
I've converted that
to a template.
-
And that's going
to let me specify
-
here on the screen which
-
template I want to use.
-
If you haven't
done this before,
-
just Google Ubuntu
Cloud Image.
-
You'll see the
first result
-
there will be the one
that you want to click.
-
You go through, you select
-
the version of a Ubuntu
you want and then
-
download the Cloud
image that you're
-
choosing to deploy
for your platform.
-
In my case,
vSphere OVA file.
-
So you're going
to go through.
-
You can give it
a pool name,
-
you can give it
the number of
-
virtual machines
that you wanted to
-
deploy. So I'm
going to do three.
-
Three is the
typical amount
-
of controllers that I
recommend deploying.
-
Have to make
sure because of
-
SCD and core Arm,
-
it needs to be
an odd number,
-
so 1, 3, 5, 7, etc.
-
And then you
can go through
-
and you can change
-
certain things like the
data center object,
-
the data store that it's
going to deploy to.
-
You can also specify
the folder that
-
you want the
virtual machines
-
to be deployed to.
-
And then once
you've done that,
-
you can go ahead and edit
-
the CPU and the
memory size to
-
be able to make
sure that you have
-
enough available capacity
-
for those controllers.
-
And then you can see here
-
in the drop down menu for
-
template where
I've actually
-
installed the Cloud
image template,
-
you can see that
I can select it.
-
Now, make sure you
select the right image.
-
Otherwise, when
you go to create
-
this cluster, it's
not going to work.
-
Now, once I've selected
the cluster image,
-
the next thing that
you can edit here is
-
the Cloud config
YAML area.
-
And so one of the
things that I
-
like to customize
here for all
-
of my nodes is
I like to add
-
a rancher user to
every virtual machine.
-
I make it part of
the wheel group,
-
I give it pseudo
privileges,
-
and then I add
an RSA key for
-
SSH to be able to log into
-
those virtual machines
once they've deployed.
-
And you can add all
different things here in
-
the Cloud config depending
-
on your needs and
requirements.
-
Like I said, at a minimum,
-
I recommend at least
adding an SSH key to
-
a user so that you
-
have access into the
virtual machines.
-
Now once that's done,
-
you can go ahead and
select the network.
-
This is the port group in
-
the vSphere environment
that you're going
-
to be attaching the
virtual machines to.
-
Make sure they have DHCP.
-
That is a requirement
that I found with
-
Rancher so that
the machines
-
automatically come up with
-
IP address information so
-
that there's
no requirement
-
on you to try and modify
-
IP configs somewhere in
-
the middle of the
boot process,
-
which typically
just doesn't work.
-
And then once
you've done that,
-
you want to go ahead and
-
create another pool by
-
clicking the plus sign
-
there on the lower
left screen.
-
Now we're going to
create our workers and
-
we're going to fill out
-
that very same
information,
-
including that Cloud
config file and
-
making sure that we choose
-
the right
template as well.
-
The last thing that
I want to do is you
-
scroll down on the
UI screen prior
-
to clicking Create is
-
actually to select
the CNI selection.
-
So you can see here in
-
the dropdown menu
that there's
-
multiple choices now for
CNIs within Rancher,
-
and you can see, again,
-
my favorite Cilium
is now available.
-
So we're going
to go ahead and
-
deploy this cluster with
-
Cilium to see how Cilium
-
is integrated through
-
Rancher and
what components
-
are there for us to
be able to start
-
leveraging straight
out of the box.
-
Now once we've gone
ahead and selected that,
-
we can review
everything that we've
-
already inputted
into the UI
-
just to make sure that
everything looks good.
-
And then we can go ahead
-
and click that
Create button and
-
it's going to
start deploying
-
the Kubernetes
cluster inside
-
of our vSphere
environment.
-
So once Rancher has
-
started creating
the environment,
-
we can go and we
can see that it
-
goes into this
provisioning state.
-
We can click on
the cluster name
-
to be able to see the
detailed information,
-
as well as
switching over to
-
the vSphere
environment to see
-
the virtual machines
being created.
-
We can watch them
from that perspective
-
or we can switch back to
-
the Rancher UI to
be able to watch
-
the cluster deploy and
the various states.
-
As before, your
mileage may vary for
-
how long it takes
to actually
-
deploy the
Kubernetes cluster.
-
Within my homelab
environment,
-
it generally takes
about 20 minutes
-
depending on how long it
-
takes to clone
the template,
-
as well as start up
the virtual machines,
-
get a DHCP address,
-
and then for Rancher
to take over and start
-
installing the
various Kubernetes
-
bits and services.
-
Typically, within
20 minutes,
-
I'll have a cluster that's
-
online and ready
for me to start
-
further configuring
additional services
-
within the Kubernetes
cluster itself,
-
such as persistent
storage and NFS.
-
Other things like the
Ingress Controller
-
is obviously a
critical one as well.
-
And so at that point,
-
we'll have a cluster that
-
we can start leveraging.
-
So you can see here
on the screen,
-
the cluster is online.
-
We can go ahead and
click it and we'll
-
actually be brought to
the cluster dashboard,
-
where we can see some
very basic information
-
around what's going on
within the cluster.
-
We can also download the
-
Kube config
file to be able
-
to connect to the
cluster via CLI.
-
I do that and I actually
-
run the CLI
straight off of
-
my Rancher virtual machine
-
where Rancher's actually
-
running as a
docker container.
-
And that just becomes my
-
central point for all of
-
my future configurations
-
and deployments
and whatnot.
-
So one of the things
-
here you can
see is there's
-
a lot of information
-
about the cluster itself.
-
You can see what the
nodes are doing,
-
you can see what
pods are running,
-
you can see
what additional
-
tools are
available to you.
-
And then we can
go through and
-
we can actually
start installing
-
Prometheus and Grafana as
-
a monitoring tool first
-
thing within the
environment.
-
Now, the first
thing that I do and
-
that you can see here
on the screen is
-
I actually install
an NFS pod
-
inside of the cluster
that connects back
-
to an NFS server that
I have running within
-
my lab that I can
-
then create persistent
volumes on.
-
So I install
the NFS piece.
-
If you want to see
how to do that,
-
I'll link in
the description
-
below a link to my
GitHub repository for
-
my Kubernetes sample app
-
where I use this same pod
-
to be able to do persistent
storage for RabbitMQ.
-
And then I go ahead
and I've created
-
a storage class
specific that I want
-
to leverage off of
-
my NFS server within
-
this Kubernetes
environment.
-
And then once
I've done that,
-
then we're ready to
actually install
-
Prometheus and Grafana and
-
make sure that we have
persistent storage for
-
those metrics so that they
-
maintain state over a
long period of time.
-
And so you can
just click on
-
the Install Monitoring
inside of Rancher.
-
Again, this is
one of the things
-
that Rancher does
really well for us
-
is that it bundles a lot
-
of these things that
are commonplace
-
within Kubernetes
clusters directly
-
through the Rancher UI
for us to leverage,
-
so we don't
have to go hunt
-
down other YAML files
or figure out what
-
other people have
done for how they've
-
deployed some of the
common applications.
-
And so you can see all
of the charts within
-
Rancher for the
various things
-
that we want to be
able to install.
-
And again, they
link right there in
-
the top right corner or
-
install monitoring
on a fresh cluster.
-
We then select the
monitoring chart,
-
and then we get here to
-
the screen for Prometheus
and being able to
-
configure Prometheus and
Grafana and customize
-
that configuration
for our environment.
-
So the first
thing that we're
-
going to do is
we're going to
-
select where we're
going to install it,
-
so we'll install it in
the default project,
-
and then we're
going to go through
-
here and we're
going to modify
-
Prometheus to be able
-
to leverage
persistent storage.
-
So we're going to
check that box
-
there on the screen for
persistent storage,
-
and then you
can see we have
-
an expanded set of
-
options that we
want to be able
-
to leverage specific to
-
persistent storage and
persistent volumes.
-
You can see when we click
-
on that storage
class name,
-
you can see that
there's the NFS client.
-
That's what default
comes with the pod,
-
and then I've created
-
that standard
storage class
-
for my Kubernetes cluster.
-
So we go ahead and
click Standard,
-
that's now hooked back
into my NFS server.
-
You can specify or
-
modify the size
if you need to.
-
And then we're going to
-
do a similar thing
for Grafana.
-
We're going to select that
-
enable with PVC
template radio button,
-
and then it's going to
-
populate some
information on
-
the screen force that's
-
specific to
persistent volumes.
-
Again, pick that standard
storage class name,
-
read write once many,
-
and then we can
specify a size,
-
and then we can go ahead
and click Install.
-
And Rancher is going to
-
automatically install
Prometheus and Grafana.
-
It's going to preconfigure
-
it with a wide variety of
-
dashboards right out of
-
the gate for us to
be able to leverage.
-
And it's also
going to open up
-
this mini shell window
-
within the UI as it shows
-
us how it's installing
-
Prometheus and Grafana
-
within the
Kubernetes cluster.
-
And then once that's done,
-
we'll be able to
see some tie ins to
-
Grafana immediately
in the branch or UI
-
for our cluster without
actually having to
-
go out to the Grafana
service that's running.
-
Although there
is a hyperlink,
-
and you'll see us
hit it here on
-
the screen in
just a moment.
-
To be able to select
the Grafana UI,
-
it opened a new window
for us in our browser.
-
Once we click that
Grafana UI hyperlink
-
and it opens up
the new browser,
-
then we're going
to see a myriad of
-
other dashboards that
instantly become
-
available for
us to be able
-
to leverage inside of
-
our Rancher Kubernetes
cluster that it's
-
deployed and is
managing for us.
-
And it's really this
streamlined operation that
-
differentiates
Rancher from several
-
of the other Kubernetes
management tools.
-
So it's had a little bit
more time to bake in
-
these features to get
-
this UI streamlined
force and to
-
make it very easy for
-
operators and Cloud
architects to be able
-
to manage and operate
-
a Kubernetes service
-
offering directly
through Rancher.
-
And so there you have it.
-
Once again, we can
see how streamlined
-
Rancher is as a management
-
tool for Kubernetes.
-
We can see how
quickly you can
-
spin up a Kubernetes
environment.
-
In future videos, I'm
going to show you how
-
to leverage
Rancher for Azure,
-
as well as deep
dive more into
-
the Cilium integrations
that we now see
-
within Rancher so that we
-
can understand what
is built in from
-
a Cilium stack perspective
-
via the Rancher installer,
-
and how we're going
to manage Cilium and
-
Rancher Kubernetes
clusters from
-
a life cycle perspective
going forward,
-
as far as doing
version upgrades,
-
deploying additional
tools like Hubble,
-
being able to leverage
-
service mesh via Cilium,
-
as well as the Ingress
Controller for Cilium
-
as well so that
we can it be
-
our simplistic CNI
stack that runs
-
everything for us from
-
a networking perspective
-
within our
Kubernetes clusters.
-
Now if you're enjoying
this content,
-
I encourage you to
subscribe to my channel,
-
turn on those
notifications
-
and hit the like button
-
and let me know
what you thought
-
of this video in
the comments below.
-
I hope this
updated version of
-
Rancher is
helpful to all of
-
you out there who are
-
striving to learn more
about Kubernetes.
-
As I've talked about in
-
previous videos this year,
-
I think that Kubernetes is
-
the one thing that
all of us should be
-
focused on in 2024 from
-
a skill set perspective
-
so that we can broaden
-
our capabilities
to be able to
-
make ourselves
more marketable
-
out there in the
job market in
-
these difficult times that
-
we find ourselves in.
-
So I hope that you're
enjoying the series,
-
I hope that you're
-
finding these
videos useful.
-
Please leave me
a comment below.
-
Please reach out to me
on X, @chrismutchler.
-
Let me know what
you think and
-
until next time, I'll
talk to you soon.