✨Day 31 : Launching your First Kubernetes Cluster with Nginx running

🎡What is Minikube?

Minikube is a tool that enables you to run Kubernetes locally on your machine. It creates a single-node Kubernetes cluster on your local computer, allowing you to develop and test Kubernetes applications without needing to set up a full-scale cluster. Minikube is great for learning Kubernetes, testing deployments, and developing applications that will eventually be deployed on a larger Kubernetes cluster.

🎡Features of Minikube

Minikube offers several key features that make it a valuable tool for developers and Kubernetes enthusiasts:

  1. Local Kubernetes Cluster: Minikube allows you to run a single-node Kubernetes cluster on your local machine, enabling you to develop and test Kubernetes applications in a local environment.

  2. Easy Setup: Minikube is easy to set up and can be installed on various operating systems, including Linux, macOS, and Windows, with minimal dependencies.

  3. Isolation: Minikube provides an isolated Kubernetes environment, allowing you to experiment with Kubernetes features without affecting your production environment.

  4. Resource Management: Minikube allows you to specify resource constraints, such as CPU and memory limits, for the Kubernetes cluster, making it suitable for testing resource-intensive applications.

  5. Add-ons: Minikube supports various add-ons, such as Kubernetes Dashboard, Heapster, and others, to enhance your Kubernetes experience.

  6. Kubernetes Version Support: Minikube supports running different versions of Kubernetes, allowing you to test your applications against specific Kubernetes versions.

  7. Integration with Docker: Minikube seamlessly integrates with Docker, allowing you to build and deploy Docker containers on the Minikube Kubernetes cluster.

  8. Networking: Minikube provides networking features that allow your Kubernetes pods to communicate with each other and with the outside world.

  9. Storage: Minikube supports various storage options, such as local storage, hostPath, and NFS, for storing data in your Kubernetes applications.

Generally, Minikube is a powerful tool for learning, testing, and developing Kubernetes applications in a local environment.

🔄Pre-requisites

  1. Ubuntu / AWS EC2 instance with t2.medium type or above.

  2. kubectl

  3. Docker

🛠Task 1 : Install minikube on your local & Create your first pod on Kubernetes through minikube.

📍Update your system packages

sudo apt-get update

📍Install Curl Package

sudo apt install -y curl wget apt-transport-https

📍Install the Docker

sudo apt install -y docker.io

📍Start and Enable Docker

sudo systemctl enable docker

📍Add the current user to the docker group (To use docker without root)

sudo usermod -aG docker $USER && newgrp docker

📍Then Once Reboot your system

sudo reboot

🕴 Install Minikube

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/

🖥Install the Kubectl

curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"

📍Make it executable and move it into your path:

chmod +x kubectl
sudo mv kubectl /usr/local/bin/

Start the Minikube

minikube start --driver=docker

☸make nginx-pod.yaml file

apiVersion: v1
kind: Pod
metadata:
  name: nginx-pod
spec:
  containers:
  - name: nginx
    image: nginx:latest
    ports:
    - containerPort: 80

👩‍🔧run nginx-pod

kubectl apply -f nginx-pod.yaml

⚙Check pod

kubectl get pods

delete the pod

kubectl delete pod nginx-pod

stop the Minikube cluster

minikube stop

delete minikube cluster

minikube delete
1
Subscribe to my newsletter

Read articles from Vivek Ashok Moudekar directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Vivek Ashok Moudekar
Vivek Ashok Moudekar

👋 Hello there! I'm Vivek, a DevOps enthusiast with a keen interest in streamlining software delivery. I hold a Master's degree in Computer Applications and have a solid foundation in key technologies such as Linux, Git, Docker, Kubernetes, and AWS. 💻 My passion lies in automation, ensuring efficient and seamless processes throughout the software development lifecycle. I thrive on creating robust CI/CD pipelines that empower teams to deliver high-quality software with confidence. 🚀 Beyond the code, I enjoy the ever-evolving world of DevOps and the challenges it brings. Join me on this journey as I explore new ways to enhance software delivery and foster a culture of continuous improvement. Let's connect, collaborate, and make the world of DevOps even more exciting together