Day 31 Launching your First Kubernetes Cluster with Nginx running

Day 31 Launching your First Kubernetes Cluster with Nginx running

Β·

3 min read

Day 31 of #90daysofdevops

Hey Techies! Welcome to this blog

In this blog, we are going to start with launching your First Kubernetes Cluster with Nginx running.

  1. What is minikube?

Ans:- Minikube is a tool which quickly sets up a local Kubernetes cluster on macOS, Linux, and Windows. It can deploy as a VM, a container, or on bare-metal.

Minikube is a pared-down version of Kubernetes that gives you all the benefits of Kubernetes with a lot less effort.

This makes it an interesting option for users who are new to containers, and also for projects in the world of edge computing and the Internet of Things.

  1. Features of minikube

Ans :- 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

Task-01:

Install Minikube on Your Local

A Simple Installation Guide

Installing Minikube is a straightforward process. Follow these steps:

Check Prerequisites: Ensure you have a

install Minikube: Use your package manager or download it from the official Minikube website.

Step-01: Open your terminal or any other cloud service.

Update System Packages

 sudo apt update
 sudo apt install docker.io

After step-1, Give docker permission for the super users of your local machine.

sudo usermod -aG docker $USER && newgrp docker

Now let's install Minikube.

curl -LO storage.googleapis.com/minikube/releases/la..

sudo install minikube-linux-amd64 /usr/local/bin/minikube

Now let's start Minikube.

minikube start

let's connect with docker.

minikube start β€” driver=docker

Now let's check the status of Minikube.

minikube status

Now we will install the Command line instruction for Minikube which is Kubectl.

sudo apt install snap

CLI for Minikube is Kubectl.

sudo snap install kubectl --classic

Now let's check the version of Kubectl.

Let's understand the concept pod

Ans:-

Pods are the smallest deployable units of computing that you can create and manage in Kubernetes.

A Pod (as in a pod of whales or pea pod) is a group of one or more containers, with shared storage and network resources, and a specification for how to run the containers. A Pod's contents are always co-located and co-scheduled, and run in a shared context. A Pod models an application-specific "logical host": it contains one or more application containers which are relatively tightly.

Task-02:

Create your first pod on Kubernetes through minikube.

Let's create a folder for the pod.

mkdir Minikube_Project && Minikube_Project

Let's Deploy Nginx!

Let's create a namespace for the Nginx pod.

kubectl create namespace nginx

kubectl get namespaces

Now, Create YAML Configuration: Define a simple YAML file describing your Nginx pod.

Create a pod.yml

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

Apply Configuration: Use the kubectl apply command to create the pod.

 kubectl apply -f pod.yml

Check Pod Status: Confirm the pod's creation and its running status.

 kubectl get pods

That's it! You've just completed the task. πŸŽ‰

Thank you so much for taking the time to read till the end! Hope you found this blog informative and helpful.

Feel free to explore more of my content, and don't hesitate to reach out if need any assistance from me or in case of you have any questions.

Happy Learning!

~kritika :)

Connect with me: linkedin.com/in/kritikashaw

Β