🚢 Getting Started with Kubernetes: A Beginner’s Guide to Container Orchestration


Let’s face it running containers locally is fun... until it's not. When your app scales across multiple containers, nodes, and environments, managing them manually becomes a nightmare. 😵💫
That’s where Kubernetes steps in like a superhero for container orchestration.
Whether you're a developer, DevOps engineer, or just curious about how big tech runs apps at scale, this guide will help you take your first steps into the world of Kubernetes without drowning in YAML. 😅
🧠 What is Kubernetes?
Kubernetes (K8s) is an open-source platform for automating the deployment, scaling, and management of containerized applications.
Kubernetes makes sure your app runs, scales, and heals itself — across multiple machines — with minimal effort.
🧰 Prerequisites
Before we dive in, make sure you’ve got:
Basic knowledge of Docker
Docker Desktop or Minikube installed
Kubernetes CLI:
kubectl
🔧 Step 1: Set Up a Local Cluster
If you’re just getting started, you don’t need a massive cloud setup. You can run Kubernetes locally using:
✅ Option 1: Docker Desktop
Comes with a built-in Kubernetes cluster
Just enable it in Docker settings
✅ Option 2: Minikube
Install Minikube with:
brew install minikube # macOS
choco install minikube # Windows
Then start your cluster:
minikube start
Boom — you're running Kubernetes locally! 🚀
📦 Step 2: Create Your First Pod
Let’s run a basic app in Kubernetes:
kubectl run hello-k8s --image=nginx
Check the pod:
kubectl get pods
You’ve just deployed your first container to Kubernetes 🎉
🌐 Step 3: Expose Your App
Now make it accessible:
kubectl expose pod hello-k8s --type=NodePort --port=80
To access it:
minikube service hello-k8s
A browser tab will open with your Nginx welcome page. Magic! 🪄
📂 Step 4: Use YAML (You’ll Eventually Love It)
Here's a basic YAML file for a deployment:
apiVersion: apps/v1
kind: Deployment
metadata:
name: hello-deployment
spec:
replicas: 2
selector:
matchLabels:
app: hello
template:
metadata:
labels:
app: hello
spec:
containers:
- name: nginx
image: nginx
Apply it:
kubectl apply -f deployment.yaml
Kubernetes now manages 2 replicas of your Nginx container.
🧭 Clear Overview: What’s Actually Happening?
Let’s break it down.
When you run a command like:
kubectl run hello-k8s --image=nginx
Kubernetes does a lot behind the scenes:
It schedules a Pod on an available node
It pulls the image (
nginx
) from Docker HubIt starts a container inside that Pod
It keeps track of the Pod’s status (Running, Crashed, etc.)
So even if it looks like a simple one-liner, Kubernetes is already orchestrating things for you.
🔍 Inside the Pod
A Pod is the smallest deployable unit in Kubernetes — it can hold one or more containers.
Think of it like a wrapper or a mini-environment that contains:
The container (e.g., your app or Nginx)
Networking config
Storage (if any)
Metadata (like labels)
To inspect what’s going on:
kubectl describe pod hello-k8s
Want to explore the commands, YAML files, and real-world practice examples I used in this blog?
Check out my open-source repo:
👉 Kubernetes-learning
A hands-on journey as I dive deeper into Kubernetes.
It includes:
Basic Pod & Deployment examples
Real-world
kubectl
commandsNotes and step-by-step walkthroughs
YAML files for practice and tweaking
Feel free to star, fork, or contribute if you’re learning too! ⭐
Follow me on Hashnode: https://hashnode.com/Kean De La Serna
Subscribe to my newsletter
Read articles from Kean Serna directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
