Kubernetes From Zero to Hero – Part 3: Setting Up Kubernetes Locally with Minikube + Deploying Your First Pod

Manas UpadhyayManas Upadhyay
3 min read

In this third installment of the "Kubernetes From Zero to Hero" series, we're diving into the practical side of Kubernetes. This article will guide you through setting up Kubernetes on your local machine using Minikube, understanding the cluster it creates, and deploying your very first Pod using a YAML file. Whether you're a beginner eager to get hands-on experience or someone looking to test Kubernetes features locally, this guide will provide you with the foundational steps to start your Kubernetes journey.

  • Install Kubernetes on your local machine using Minikube

  • Understand the cluster it creates

  • Deploy your very first Pod using a YAML file


What is Minikube?

Minikube is a lightweight Kubernetes implementation that creates a single-node cluster on your local system.

It's perfect for:

  • Beginners

  • Testing manifests (YAML files)

  • Playing with features (ingress, storage, volumes, etc.)

Key features:

  • Cross-platform (Windows, macOS, Linux)

  • Supports addons like Ingress, Dashboard, metrics-server

  • Works with Docker or its VM-based runtimes


Prerequisites

Before installing Minikube, make sure you have:

1. kubectl

  • Command-line tool to interact with Kubernetes.

  • Install via

      brew install kubectl  # macOS
      sudo apt install kubectl  # Ubuntu
    

To verify:

kubectl version --client

2. Minikube

Install it based on your OS:

macOS:

brew install minikube

Linux:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

Windows (PowerShell):

choco install minikube

To verify:

minikube version

3. Container Runtime or VM

Minikube can run using:

  • Docker (recommended)

  • VirtualBox

  • HyperKit (macOS)

  • KVM2 (Linux)

Verify Docker is running:

docker version

Start Your Cluster

To start your local Kubernetes cluster:

minikube start

You’ll see something like:

😄  minikube v1.32.0 on Darwin 13.0
✨  Using the docker driver based on user configuration
👍  Starting control plane node minikube in cluster minikube
...

Minikube sets up:

  • Control plane (API Server, Scheduler, etc.)

  • Worker node (same machine)

  • Kubelet and Kube-proxy

  • etcd and networking

To see your cluster nodes:

kubectl get nodes

Expected output:

NAME       STATUS   ROLES           AGE     VERSION
minikube   Ready    control-plane   3m12s   v1.29.1

Deploy Your First Pod

Let’s deploy a simple Nginx Pod using YAML.

📄 nginx-pod.yaml

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

Apply the manifest:

kubectl apply -f nginx-pod.yaml

Check its status:

kubectl get pods

Expected:

NAME       READY   STATUS    RESTARTS   AGE
my-nginx   1/1     Running   0          10s

What Just Happened?

  1. You defined a pod manifest in YAML.

  2. kubectl sent the spec to the API Server.

  3. The Scheduler assigned it to your Minikube node.

  4. Kubelet pulled the nginx image and started the container.

  5. You now have a running pod!


Accessing the Pod

Let’s check the pod in action:

  1. Start a proxy to access K8s services:
kubectl port-forward pod/my-nginx 8080:80
  1. In your browser:
http://localhost:8080

You’ll see the default Nginx welcome page.


🧹 Cleanup

To delete the pod:

kubectl delete pod my-nginx

To stop Minikube:

minikube stop

To delete the cluster entirely:

minikube delete

Summary

  • You installed Minikube and kubectl

  • You started a local K8s cluster

  • You deployed and interacted with your first Pod

  • You wrote your first YAML and understood pod lifecycles


Coming Up Next

In Part 4 of this series:

  • Learn about Deployments, ReplicaSets, and Scaling

  • Use kubectl scale, apply, and rolling updates

  • Create self-healing apps with declarative configs

0
Subscribe to my newsletter

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

Written by

Manas Upadhyay
Manas Upadhyay

I am an experienced AWS Cloud and DevOps Architect with a strong background in designing, deploying, and managing cloud infrastructure using modern automation tools and cloud-native technologies.