Hello everyone. This is Sudipta from Technical Potpourri,
and today I'm going to show you how to run Kubernetes locally on your laptop. The first option you have is Minikube. It's a very popular option. You can see the link in the
screen with this option. You have some limitation of only
one master node and one worker node. But to start with, this is a very easy
installation and it's a very easy option. The second option is Docker Desktop. Again, the link is in the screen
and this is my favorite option. My rest of the videos will be
based on this Docker Desktop. And in this video also I'm going
to show you how you can install and configure Docker Desktop with Kubernetes. But with this option also, you
have the limitation of only one worker node and one master node. Now if you want to deal with
more worker node and more master node, your option is kind. It's called Kubernetes in Docker. The link is in the screen, and this
is a more powerful option compared to Minikube or Docker Desktop. And the final option is kubeadm. And with kubeadm, you get all the
flexibility of, multiple worker nodes, multiple master node and all these things. But to start with, I will
go ahead with the docker. So now let's go and configure Docker. Now installation of Docker is very easy. Once you go Google and search for
install Docker, Desktop for Mac or Windows based on which you know operating
system that you are using, you'll come to this page and download the Docker. So in my case, I'm using Mac,
so I've already downloaded the Docker and install that. Once you install Docker,
you need to start. And once you start Docker, you will
find an option here at the very top. And if you open that,
you'll find this window. In this window, the first thing that you
need to remember, that you need to enable Kubernetes, the way to enable Kubernetes,
you go to this gear icon and click on Kubernetes and check this checkbox. Initially, when you first time log in
and install, this will be unchecked, so you need to check this checkbox
and click on Apply and restart. So with that way, you'll
find two option here. One will show that your Docker is running. Another option will show that your
Kubernetes engine is also running. So with both this option done, you open
your terminal like this is my terminal. You open your terminal and to make
sure that Kubernetes is really installed, you need to type a
common called kubectl and enter. The moment you do that, you'll
find all the options here. And if you find this option, it
means Kubernetes is running for you. With Kubernetes, there are
multiple commands that you can run. I'll be creating a dedicated video
with all the Kubernetes commands. But for the timing, let
execute only this command. Make sure that Kubernetes
is correctly installed. Now. As you can see, the Kubernetes
is already successfully deployed. In Docker. So next thing what I want to do,
I want to deploy a dashboard ui. And with the dashboard UI, it'll be very
easy for me to check the status of the Docker as well as Kubernetes engine. Now, in order to do that, there are
a couple of steps that I need to perform , which I've listed down here. The first thing is that I need
to deploy the dashboard UI, and this is a URL for that. So if I open this URL here, it's a
Kubernetes help desk and here, this is how the dashboard will look like. So it's more like a visual representation
of all the things that is happening inside your Kubernetes engine. Like number of pods, how pods are doing,
what is the CPU usage, memory usage. So it's very easy that if you see
visually how your pods are working or how your Kubernetes engine is working. So the first thing that I need to
do, I need to deploy the dashboard, and the command for this is this one. I always recommend that you come to the
official documentation page and copy from here because this URL will keep on
changing based on different versions. So for this one, I'm just copy this one
and going to execute that in my terminal. Before that, I'm going to clear the
terminal and execute the command. And as you can see, it created couple
of services, Kubernetes dashboard. It created some sort
secrets and all this thing. Now to access this dashboard, what
I need to do, I need to create an admin user and get the bearer
token again, the link is here. Which also you can find from here,
the accessing the dashboard ui. They're telling that you need
to create a sample user and get the bearer token from there. So let me open that. The first thing that we need to
do, we need to create a YML file, a configuration file, and store
that file in some directory. So I'm going to create a
directory called My Dashboard. So I am here and I'm going to create
a director called my dashboard, and then I'm going inside that. So now my folder is ready. So the first thing that I'll
do, I'll go and create this configuration file or the YML file. And inside this YML file, I'm
going to copy the this content to create the service account. And save that. Now I'm going to apply this
YML file to create my user, and here is a command for that. My user is ready. With the user ready, I'm going
to create a token for that user. And here is a token. So now I am going to copy this
token with my token ready. I'll come back to this page
again and I will start the proxy. The command for this is kubectl proxy. So let me type that kubectl proxy,
and the proxy server started. With the proxy server started, if I right
click and open this URL in a new tab. It is asking for a token. The token I've already copied and
pasting here and click on sign. . The moment I do that, this is a web UI. Here you can find all pods and everything. Currently there is nothing. That's why you are not seeing anything. But from this dropdown, from the
default, if I choose all namespace, you can see that deployment, number
of pods, everything you can see from. So this is a way how we can
install this dashboard ui. And from this dashboard UI, you can
visually see all the states, like the number of nodes that is running,
number of pods that's running. You can click on individual pod
and see the status of the pod. I hope this video is helpful. Please hit the like icon and please
subscribe to my channel so that you get update about all my upcoming video. Till then. Thank you. Bye-bye.