Launching your First Kubernetes Cluster
What is minikube?
Minikube is software that allows users to run a Kubernetes cluster of just a single node. It is rather fast to set up and makes for a perfect testing environment for developers to see how their containerized application will run on Kubernetes. It is not meant for production, but rather to test applications and deployment settings to see how they fare before sending them to a production environment.
- Minikube Pros:
Ease of use: When compared to other Kubernetes tools, minikube is easy to use and initially set up. It comes with many settings already configured out of the box, so you can get going quickly.
Development: Minikube is ideal for developers who need to test their containers or deployments before sending them into production. By the same logic, it is also useful for Kubernetes administrators to see how something runs before pushing the settings to their production Kubernetes cluster such as kubeadm.
Studying: Minikube is a perfect starting point for newcomers who want to get a foot in the door by building Kubernetes clusters. It gives us all the tools we need to package a containerized application, launch it as a pod, and then play with deployment settings via the kubectl command.
- Minikube Cons:
Limited scope: Since minikube is only meant for development and testing purposes, it is just a single node and will not give much benefit to running Kubernetes via minikube rather than running a container directly. It is mostly pointless to try using it in a production environment.
- Features of minikube
(a) Supports the latest Kubernetes release (+6 previous minor versions)
(b) Cross-platform (Linux, macOS, Windows)
(c) Deploy as a VM, a container, or on bare-metal
(d) Multiple container runtimes (CRI-O, containerd, docker)
(e) Direct API endpoint for blazing-fast image load and build
(f) Advanced features such as LoadBalancer, filesystem mounts, FeatureGates, and network policy
(g) Addons for easily installed Kubernetes applications
(h) Supports common CI environments
☸ Kubernetes Installations tool
Minikube
Kubeadm
Kubernetes Installations and Configurations
- Login into AWS account-> Launch 2 Instances--> Ubuntu 22.04 LTS (t2.medium) Master must have 2 VCPUs and 4GB RAM and for Worker Node instance type
Step 1: Update System Packages
Update your package lists to make sure you are getting the latest version and dependencies.
sudo apt update
Step 2: Install Required Packages
sudo apt install -y curl wget apt-transport-https
Step 3: Install Docker
Minikube can run a Kubernetes cluster either in a VM or locally via Docker. This guide demonstrates the Docker method.
sudo apt install -y docker.io
Start and enable Docker and Add current user to docker group (To use docker without root)
sudo systemctl enable --now docker
sudo usermod -aG docker $USER && newgrp docker
Step 4: Install Minikube
First, download the Minikube binary using curl
:
curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
Make it executable and move it into your path:
chmod +x minikube
sudo mv minikube /usr/local/bin/
Step 5: Install kubectl
Download kubectl, which is a Kubernetes command-line tool.
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
Check above image ⬆️ Make it executable and move it into your path:
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
Step 6: Start Minikube
Now, you can start Minikube with the following command:
minikube start --driver=docker
This command will start a single-node Kubernetes cluster inside a Docker container.
Step 7: Check Cluster Status
Check the cluster status with:
minikube status
You can also use kubectl
to interact with your cluster:
kubectl get nodes
Step 8: Stop Minikube
When you are done, you can stop the Minikube cluster with:
minikube stop
Delete Minikube Cluster
If you wish to delete the Minikube cluster entirely, you can do so with:
minikube delete
Thank you for reading my blog! Happy Learning!!!😊
Subscribe to my newsletter
Read articles from Suraj barik directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Suraj barik
Suraj barik
I'm Suraj Barik Aspiring DevOps Engineer with Hands-on experience in Automating,Shell Scripting, Supporting in AWS, management, CI/CD, and DevOps processes.