First Kubernetes Cluster launch with Nginx running in MINIKUBE

NILESH GUPTANILESH GUPTA
2 min read

What is minikube?

Minikube is a tool that 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.

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

Install minikube on your local

To confirm the successful installation of both a hypervisor and Minikube, you can run the following command to start up a local Kubernetes cluster

Now Minikube is installed and ready.

Let's understand the concept of pod

A Pod is the smallest unit in Kubernetes, representing a single instance of a running process. Pods can contain one or more containers that share the same network namespace and storage.

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 that are relatively tightly coupled.

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

In this example, we define a Pod named "nginx-pod" running an Nginx container

Create your first pod on Kubernetes through Minikube.

Install kubectl using command

sudo snap install kubectl --classic

Create a folder, inside the folder, create yml file/manifest file

pod.yml

To check the list of pods:

kubectl get pods

You can view a list of pods (ngnix pod) in the running state

Happy Learning.

0
Subscribe to my newsletter

Read articles from NILESH GUPTA directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

NILESH GUPTA
NILESH GUPTA