- [Instructor] The Kubernetes Dashboard is a simple,
web-user interface for Kubernetes clusters.
It allows users to manage and troubleshoot applications
running into cluster, as well as manage the cluster itself.
One of the most common asks in the container world
is for the need for a UI to visualize what's going on
with the cluster.
It was one of the most requested features of Docker
when it first started and is a common requirement
for DevOps engineers to manage clusters.
Kubernetes learned this lesson early on
and created the Kubernetes Dashboard for this very purpose.
And it allows you to monitor and view clusters
from an operational perspective.
So let's go ahead and see how we can run this in Minikube.
I'm going to flip over to my terminal.
Let's make sure Minikube is up and running.
To do this, I can do a minikube status
and kubelet and API server, everything seems to be running.
One thing I like about Minikube
are the add-ons, and the Kubernetes Dashboard
actually comes bundled as an add-on inside of Minikube.
So let's take a look at the add-ons.
So if I do a minikube addons list, we'll notice
that there are a bunch of different add-ons
inside of Minikube that are already bundled.
So in here, we'll notice the dashboard
that is in a disabled state.
So let's go ahead and enable that and clear my screen.
Minikube addons enable dashboard.
It says that the dashboard is enabled,
but it also says some dashboard features
require the metrics-server add-on.
To enable all the features,
please run Minikube addons enable metrics-server.
So this is just telling us
that we want to enable the metrics-server add-on
in order to get CPU and member information
that's also shown under dashboard.
So let's go ahead and do that.
So I'll do a copy of that.
Minikube addons enabled metrics-server.
And this says that the metrics-servers add-on is enabled.
So let's look at our add-on list again.
Minikube addons list.
So now we see here that the dashboard's enabled,
as well as the metrics-server.
Great.
It seems like things are online.
So let's run the dashboard.
To start it up, I can type minikube dashboard
and this will pull up the dashboard in my web browser.
We notice at first that we see the CPU usage
and the memory usage, and this is actually given to us
by the metrics-server that we just enabled.
We'll notice at the very top,
we have a thing called default.
This is actually all of the different namespaces
that we have in the cluster, and by default,
the dashboard will show you everything
in the default namespace,
but we can also change this
to look at all the different namespaces as well.
So in our entire cluster,
we have workload statuses for the daemon sets,
deployments, pods, replica sets, et cetera.
I'm going to flip this back to the default cluster.
And here we have information
about the deployments that we had.
So from the last chapter, we had the frontend
and the Mongo DB deployment.
We still have those existing.
They were created 26 minutes ago.
Shows us the images, et cetera.
You can get a sense of all the different workloads
like the pods.
We can get information about the replica sets, et cetera.
And you'll notice that the information up here with the CPU
and the memory usage changes
depending on what we're actually looking at.
Next up, we have the services.
So the different services running in the default namespace
and any kind of configuration.
So if you want to look at the different config maps
that you have in your cluster or your namespace
or secrets, et cetera,
you can kind of take a look at them over there.
Information about the cluster,
such as the role bindings and roles, et cetera,
and also the CRD definitions as well.
One quick thing I really like
is the little search functionality that we have up top.
So I can search for frontend, et cetera.
And any time there's a deployment or a pod
associated with the name frontend, we can see that.
So let's actually hop into a deployment.
There are a couple of things here I want to touch on.
So one thing I find myself doing every now and then
is, for a specific deployment,
if I don't want to muck with the YAML,
I can actually edit the different resources in here as well.
So I can hit this edit resource button,
and this shows us the YAML for the deployment,
and it shows us all the information
associated with the deployment.
So if, for some reason, I wanted to add a different label,
for example, so I can do an app.kubernetes.io/customlabel.
And I'll just call this, Hello, as the value.
And I can do an update.
This action is equivalent to running
the kube-CTL-apply command for the specific spec,
but I'm going to do that.
And here in just a second,
we'll notice that we ended up adding the custom label.
So custom label, Hello.
And the other thing you might end up using this for
is to change the number of replicas.
So by default, this replica had...
or this deployment had three replicas,
and you can change that to two or more.
Let's bump this up to four and we can do a scale.
And once again, the command associated with this
is kube CTL scale minus N, the deployment name, frontend,
and then set the replicas to four.
So once again, under pods status,
we saw that change from three to four,
and we don't have any old replica sets, et cetera.
The other thing you might use the dashboard for
is to actually look at events.
So any events associated with the deployment
is shown here in the events
and let's look at pods real quick as well.
There's a couple of things in pods
that end up making this really useful.
I'm going to pick an arbitrary pod.
So I'm going to pick the frontend pod.
And a couple of things that are useful with the pods
specifically are you can view logs,
you can exec into a pod
and also change resources in the pod
like we could do for deployments.
So let's look at the logs for this pod.
So instead of doing a kube-CTL-logs command,
you can look at the logs directly for the specific pod,
as well as, if we try and exec into the pod,
we do get a shell inside of the guest book
for the specific pod itself.
So you can do an LS minus AL, for example,
and this is execing into the pod
and showing you what's running inside of the pod.
One last thing I want to show you in the dashboard
is that you can actually create resources
from the dashboard itself.
It's not a feature that a lot of folks use that much,
but it's still really useful.
In order to do that,
you can click the create new resource icon from the top,
the little plus sign, and click that.
And we have three options here.
You can create from input,
where you can enter your existing YAML or JSON content.
You can create from a file,
where you can paste a specific file,
or you can create from a form.
For ease of use,
I'm just going to create something from the form.
So let's give this an app name.
I'm going to call it helloworld.
A container image.
So I'll use my karthequian/helloworld latest.
And let's say, I'll do four pods
and I don't really need a service for this.
So I'm going to hit deploy.
And we'll notice that we went back to the main screen.
There's the KNS app.
There's a deployment that's not online.
So you'll notice that there's zero of four pods available
just yet.
If we give this a little bit of time,
we'll notice that everything turned green,
as well as four of four pods available.
And we're back in a happy state.
So there you have it.
Going to go into the dashboard,
or rather go into this deployment.
Everything seems to be running as expected,
and we actually created this helloworld deployment
from the dashboard itself.
So this is just a quick overview
of the Kubernetes Dashboard.
Gives you a quick look and feel of what the dashboard is
and what it does, and hopefully you find it useful.