Hi in the earlier lecture we saw what are all the components involved as a part of
kubernetes cluster. Now we are going to start with the installation of single node
cluster that is minikube, where all the components will be made to run in a
single instance. As we discussed earlier the installation of minikube involves two
components, one is the minikube as such and then kubectl that is the client that's going
to interact with minikube and minikube it's available as a VM or it can be
installed as a native component, if the operating system is of linux or mac os.
Now I am going to demonstrate how to do the installation within windows.
Now let's go through the prerequisites the first thing is we need to have oracle VM and that can
be downloaded from oracle VM website and and once the windows virtualization
is enabled I can go ahead and do the installation of oracle VM. Immediately
after installing there will not be any VM visible and in my case I do have the other
VM's for different purpose, I'm not going to worry about it, I am going to download
the minikube from kubernetes website. If I get into kubernetes website here I do
have the instructions to do the installation for various operating
systems and to have understanding on whether this system met the prerequisite
or not I can execute the command system info that's going to give me the
information on hyper-v whether it is enabled or not, as a part of the command
prompt I have executed the command and got this particular output. That means the
hypervisor and virtualization is enabled and within windows I do have option
to download the windows installer that is minikube installer.exe and execute it. This
is an exe file, so I can directly download and execute it before that I need to make
sure the virtualbox or hyper-v is installed and I need to have the installation of
kubectl as well. Kubectl can be downloaded as a installer and I can add
the location into the path. Already I have downloaded kubectl from this specific
location, by clicking this specific link and it's added in the windows directory in this
specific location. I have kubectl downloaded and it is available over here.
and I can add this particular location within the path. So I can get into the
system properties, advanced system settings, environmental variable as a part
of system variables I can edit the path and add the location where I do have the
kubectl exe, this will enable me to execute the kubectl command from any
location. Let me open the powershell I can open the powershell shift and right click
will give me this option to open the powershell or command prompt. Here I can
provide the command kubectl and this is the client which will facilitate me to
interact with the minikube. Now I am going to install the minikube, let me go
ahead and run the installer. Let me move on to the next screen already I have done
the installation, I'm going to go till the last screen, here is where the minikube is
installed I can open the specific location within program files kubernetes minikube
minikube is installed, the same location is added within the path as well. So I will
be in a position to execute the minikube command as well. So once the
installation gets over I can execute the command minikube. This is going to
provide me the options that I can provide as a part of minikube. Now I'm going to
use the minikube command to start the VM. I can provide the command minikube
status, so there is no host kubelet or API server nothing is installed. Now let me go
ahead and start the minikube and I need to provide the driver as virtualbox. As I do
have a virtual box as the hypervisor, I'm going to provide driver as virtualbox
minikube start driver virtualbox. Now it will communicate with the virtual box
and check whether the minikube VM is existing if it is not existing it will go
ahead and create one. I don't have the minikube VM, so it's going to download
the VM that is the image and it will create the virtual machine, it is creating the
virtual machine with two CPUs and 4GB of memory and disk as 20 GB and check
the status of the VM minikube VM is created and it is running within the VM
required softwares like kubernetes and docker will get installed, required addon
will get added into the VM and kubectl will be configured to use the minikube
host. Now I can go ahead and check the status of minikube. I do have the
information kube configuration is done API server is running kubelet is running
host is running. So what happened one VM got installed and all the components
is installed in a single system. So within the single system I will be having all the
components that is kube scheduler, controller, API sever, etcd everything will
get installed in a single host and I will be in a position to communicate with the
API server using the kubectl. Now I can use the kubectl command say for
example get pods. There are no pods available. Now let me go ahead and create
a small deployment and don't worry about the syntax we will be discussing
detail on the syntax this is just to verify whether the installation went through
fine or not and I will be adding all the commands as a part of resources within
each and every lecture, so you can copy paste the same command in your demo
environment as well. So I'm going to create something called deployment and
I will be giving a name hello minikube and I will use the image available within
this specific location. This is a popular sample called echo server which is going
to provide the meta information about the server, so a pod should get created
now let me go ahead and check the pods available. I do have one pod this is
the name of the pod and the status it is saying container is getting created. After
few minutes it should be up and running in the meantime let me go ahead and
start another useful add on called dash board. I can give the command minikube
dashboard which will start a dashboard and that will be running locally within the
same system and I will be in a position to access using the URL. The specific URL
and the port it will be different for different users, so copy the same link
that you are getting over here and this is going to give visual information on what
are the deployments, what are all the pods running, what are all their status and
this is the actual dashboard we will be using it in production to get the entire
information about the cluster. We will have the complete details on how many
nodes running and we do have only one node as we are running minikube only
one node is running and the resource utilization every information we can get from this
specific dashboard. So deployment of the pod as well as the dashboard gives us
the confirmation the installation went through fine within windows operating
system and once if I come out of this particular control the dashboard will stop
working, in case if I wanted to run some other commands do open another
terminal. So you can open a powershell and provide the commands kubectl get
pods. So I do have one pod which is in the running state. After you're done with the
demo in case if you wanted to stop the virtualbox you can run that command
minikube space stop that will stop the virtualbox that is running the virtualbox
minikube will get into the powered off state. To start I can use the command
minikube start and then the driver virtualbox, the virtualbox that is already
existing will get started automatically. So it will identify the virtualbox mini cube is
already existing and it'll get into the starting state. In case if the minikube is
not required I can go ahead stop it and delete them. minikube stop that will stop
the VM and issue the command minikube delete. So that will delete the
virtualbox I can go ahead and verify it within the virtual box and it is deleted.
So in a quick summary we had seen what are all the prerequisites to do the installation of
minikube as a part of windows operating system and do the installation and check
whether the kubectl command is working along with minikube dashboard.