Deploying a Local Kubernetes Cluster using Minikube 🚢 🚢

Vibhor Chinda
Google Cloud - Community
5 min readNov 2, 2022

How to setup a local Kubernetes cluster using Minikube ??

Introduction 🚩🚩

Hi fellow Readers 👋 :))
I believe that in order to learn any new technology or piece of software, getting your hands dirty with that tech is important. Learning only theory without or very less hand on experience shall bring no use to the learner.

So In this article, we will try to learn about :

  • What is Minikube ??
  • Installing the prerequisite softwares on the local machine. (Docker & kubectl)
  • Steps to set up Minikube and deploy a three nodes cluster using Minikube.

It will be a very short and crisp article.
So without any further delay, lets get started with it :))

**Note : The OS I am using is “Ubuntu 20.04.5”

What is Minikube ?? 🤔🤔

Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing one or multiple nodes.
Minikube is available for Linux, macOS, and Windows systems. The Minikube CLI provides basic bootstrapping operations for working with your cluster, including start, stop, status, and delete commands.

In simple terms, Minikube is a software which helps to deploy a single or multi nodes Kubernetes cluster on your local machine either it be windows, macOS or Linux.

Setting up the Prerequisites [Docker & kubectl] 😏 😏

  • Open terminal Prompt
  • Check whether docker is already installed or not
docker --version
  • If docker is not installed, run the following command
sudo apt install docker.io
  • Check whether docker is successfully installed or not
docker --version
  • Open terminal Prompt
  • Check whether kubectl is already installed or not
kubectl version
  • If kubectl is not installed, run the following command
sudo snap install kubectl --classic
  • Check whether kubectl is successfully installed or not
kubectl

Now we have successfully installed the prerequisite software. Let us move to the Minikube section :))

**Note : All the above demo & screenshots are being done on “Ubuntu 20.04.5”

Steps to set up Minikube and deploy a three nodes cluster using it 🤓 🤓

Photo by Alyssa Kibiloski on Unsplash
  • Open terminal Prompt
  • Check whether minikube is already installed or not
minikube
  • Choose the machine type you want to install minikube on.
    Like I am working on Linux so I have selected below shown configurations. (Make sure this is right as depending on the machine type, it will produce the link to install minikube)
  • Copy and run the command to install minikube from the official page [**Note : Command will be different for different target machine]
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64sudo install minikube-linux-amd64 /usr/local/bin/minikube
  • Check whether minikube is successfully installed or not
minikube version
  • Run the below command to trigger a 3 node Kubernetes cluster
    [**Note : Below command will create a 3 nodes local Kubernetes cluster named “local-cluster-vibhor”]
minikube start --nodes 3 -p local-cluster-vibhor --driver=docker
  • Check whether the cluster is deployed correctly or not
kubectl get nodes

One Master node → local-cluster-vibhor
Two Slave nodes → local-cluster-vibhor-m02, local-cluster-vibhor-m03

Hurray !! 🥳 🥳 Now we have successfully deployed a multi node cluster on our local machine.

**Note : All the above demo & screenshots are being done on “Ubuntu 20.04.5”

What next ? 👀 👀

Thanks a lot for reaching till here! This is the end of this article.
But we have only scratched the surface of the K8s ecosystem :))
Much more to go, it will be a fun journey where we will learn a lot of cool stuff together.

Do clap and follow me 🙈 if you like my writings and want to read more from me in the future :))

In case of any doubts around this article or for some general chit chat, feel free to reach out to me on my social media handles

Twitter — https://twitter.com/ChindaVibhor

LinkedIn — https://www.linkedin.com/in/vibhor-chinda-465927169/

Related Articles

I will still keep on coming with new articles covering a bunch of topics I am exploring.

That’s All folks !! Doodles :))

--

--

Vibhor Chinda
Google Cloud - Community

Software Developer 2 @Guidewire | Ex - VMware | CKA | Exploring Cloud Tech | Developing Patience ✨✨