In this lab we get familiar with the monitoring cluster components.
The first question is we've deployed
a few PODs running workloads so inspect them.
Let's do kubectl get pods command
and we see that there are indeed three pods, elephant, lion,
and rabbit and they're all in a running state so let's go ahead.
What we need to do is monitor the resources consumed
by each of these PODs.
For that, we need to deploy the metric server.
For this, we have a git repo with the settings for the metrics-server
that will work for our labs so we're just going to use that.
If you're trying this in your own environment
or for a production environment, remember do not use this for production
use cases because there are changes
that are in here that are done just to make
this work with this particular lab exercise
and just to make it easy for us to deploy
it so do not use this for a production use-case.
Always remember to refer to the official documentation
on the metrics server to deploy one in your environment.
This is cloned, and if you look at this,
you have
the files here that are required
to deploy the metric server, so go ahead.
The next step is to deploy the metrics server
by creating these components.
We're just going to do kubectl create -f.
And that creates all of the objects
required to deploy the metrics server.
Let's go next.
At times it might take a few minutes
for the metrics servers to start gathering and reporting data
and so if you do a kubectl top node,
it seems to be working already.
That's working now so we can proceed.
The next question is to identify the node that consumes the most CPU.
Here you can see two nodes and the CPU consumption of the two.
Node01 has 57m
and the control plane consumes about 470m.
If you look at it, the percentage is just 1% but still,
you can see there's a difference between the two.
Of course, that's because the control plane
has all the control plane components running on it.
To answer this question,
the most CPU consumption is by the control plane.
Let's select that.
The next one is to identify the node that consumes the most memory.
If you look at the memory consumption here,
again we can see that the control plane consumes
most memory so the answer to this is control plane again.
The next question is to identify the POD that consumes the most memory.
The POD this time,
you can get that by running the kubectl top POD command.
Here you can see the memory consumption and the CPU consumption.
If you look at the memory consumption, you can see that it's rabbit.
The rabbit consumes the most memory so the answer to this is rabbit.
The next question is to identify the POD that consumes the least CPU.
Here you can see it's lion.
This consumes 1m of CPU, select lion.
That should be it.
Basically, that's a quick introduction to deploying the metrics-server
and also just using the commands to look at its reporting
and identify basic information.
Thank you