My First Steps with Kubernetes: Setting Up Minikube and Running My First App

👋 Hello world! I recently began my journey into Kubernetes—a powerful system for managing containerised applications. As a beginner, I had no idea what I was getting into, but I decided to take baby steps to show newbies how to get started.

In this post, I’ll share what I’ve learnt using real-world analogies and walk you through how I set up my own mini Kubernetes cluster and ran my first app using Minikube and kubectl.


🧠 What is Kubernetes?

Kubernetes (often abbreviated as K8s) is an open-source platform for automating the deployment, scaling, and management of containerised applications.


🧱 Real-Life Analogy: A Container Shipping Yard

Imagine you run a massive shipping yard where goods arrive from all over the world in standardised containers. You have:

  • Forklifts to move containers

  • Cranes to stack them

  • Software to track where each container is

  • Workers to inspect and manage the whole system

Now, imagine if all of this were automated and intelligent—containers are moved, stacked, scaled, or replaced without human intervention.

➡️ That’s exactly what Kubernetes does, but for software containers (like Docker). It’s your automated container orchestration system.


📦 Containers First: Why Do We Need Kubernetes?

Containers (e.g., Docker) let you package your application and all its dependencies into a portable unit. But running containers alone is like having cargo but no shipping yard.

Now imagine:

  • You have 100 containers

  • Some crash and need restarting

  • Some get more traffic and need to scale

  • Some need to be updated without downtime

  • You want to distribute them across multiple servers

➡️ You need something to manage and orchestrate all this: Kubernetes.


🛠️ Key Features of Kubernetes

FeatureWhat It DoesReal-World Analogy
PodsRun your containerized appsTrucks carrying a container
NodesMachines (VMs or servers) that run PodsLoading docks
DeploymentsManage how and when apps are deployedDelivery schedules
ServicesAllow access to your appsCustoms gates or pickup areas
ScalingIncrease or decrease container replicasAdding more trucks for high demand
Self-healingAutomatically restarts failed containersAutomated fault detection and recovery

🔁 Summary

Kubernetes is like the brain of a smart shipping yard, ensuring:

  • Applications (containers) are delivered and maintained reliably

  • Resources are used efficiently

  • Failures are automatically fixed

  • Updates happen with zero downtime

In short:

Kubernetes = Automated, intelligent management of your app containers.

🧰 Tools I Installed to Begin My Journey

To start playing with Kubernetes, I needed three essential tools:

🐳 1. Docker

What it is: A container engine that packages and runs applications in isolated environments (containers).

Analogy: Think of Docker as a shipping container factory. It lets you package your app with everything it needs and ship it anywhere.

Command I ran to verify:

docker --version


📡 2. kubectl

What it is: A command-line tool to interact with the Kubernetes cluster.

Analogy: It’s like the walkie-talkie used by the airport manager (you) to talk to your airport control tower (Kubernetes).

Command I ran to verify:

kubectl version --client


🧪 3. Minikube

What it is: A tool that sets up a small, local Kubernetes cluster on your machine so you can practice safely.

Analogy: It’s like building a mini airport simulator in your bedroom to train how real airports work.

Command I ran to start the cluster:

minikube start


🔍 Exploring My First Kubernetes Cluster

After starting Minikube, I ran:

kubectl get nodes

Explanation:

  • This showed me the worker machines (nodes) in my cluster.

  • In my mini-airport, this is the ground staff or workers who handle the actual flights (applications).

Then I checked:

kubectl get pods --all-namespaces

I saw various system pods like:

  • kube-apiserver

  • kube-scheduler

  • kube-dns

These are like the air traffic controllers that help manage where planes go and how everything communicates inside the airport.


🚀 Deploying My First App: The Hello World of Kubernetes

Step 1: Deploy NGINX

kubectl create deployment hello-nginx --image=nginx

What happened?
This command asked Kubernetes to:

  • Create a Deployment named hello-nginx

  • Use the nginx image (a lightweight web server)

  • Run it inside a Pod

Analogy:

  • This is like telling your airport control tower:
    “Start 1 plane with the NGINX logo and keep it running.”

Step 2: Expose It As a Service

kubectl expose deployment hello-nginx --type=NodePort --port=80

What happened?
I created a Service so I (and others) can access the app.

Analogy:

  • This is like opening a phone line (or terminal gate) to let passengers (users) access the plane (app).

Step 3: Open the App

minikube service hello-nginx --url

This gave me a link like:
http://127.0.0.1:33540

When I opened it in my browser, I saw the Nginx Welcome Page! 🎉


🧠 Key Concepts I Learned

Kubernetes ConceptReal-Life AnalogyWhat I Did
ClusterAirportCreated using Minikube
NodeAirport staffChecked via kubectl get nodes
PodAirplaneRuns the app container
DeploymentAirport managerManages app lifecycle
ServiceTerminal gateOpens access to the app

📝 My Final Thoughts

Starting with Kubernetes felt like learning how an airport works while standing on the runway. But once I understood the basic moving parts and related them to real-life systems, things began to make sense.

With just 3 commands, I deployed a fully running app, exposed it to the world (well, my browser), and started understanding what makes Kubernetes so powerful.


🔜 Coming Up Next

In my next post, I’ll dive deeper into:

  • How Pods, Deployments, and Services work under the hood

  • Building a real-world guestbook app with a database

  • Scaling and updating apps with zero downtime

Thanks for reading! 🙌
Feel free to comment or connect—let’s learn Kubernetes together. 💡

0
Subscribe to my newsletter

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

Written by

Olaoluwa Afolami
Olaoluwa Afolami

Detail-oriented and dedicated Cloud/DevOps Engineer with experience in designing, deploying, and managing cloud infrastructure across Azure, AWS and GCP environments. Strong expertise in cybersecurity, system administration, and incident management. Proven history of success in IT support roles, with proficiency in Linux and Windows server administration, virtualisation, identity management, and Active Directory. Committed to enhancing security, optimising system performance, and ensuring the reliability of IT infrastructure.