βWhen I first heard about Kubernetes, it sounded like a sci-fi robotβs name. But soon I realized itβs more like the traffic police of our applications β making sure everything runs smoothly, no matter how messy the road gets.β
Hello everyone π,
In this post, Iβll walk you through Kubernetes (K8s) in the simplest way possible. If youβre just starting, donβt worry β Iβll cover the what, why, and how in plain English and then show you how to set it up on Windows, Linux, and Mac.
Think of Kubernetes as a system manager for your apps.
In short β Kubernetes = Container Orchestrator πΆ
Weβll use Minikube (a lightweight tool to run Kubernetes on your laptop). It sets up a local cluster where you can practice.
Set-ExecutionPolicy Bypass -Scope Process -Force; `
[System.Net.ServicePointManager]::SecurityProtocol = `
[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; `
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install kubernetes-cli
choco install minikube
minikube start --driver=docker
π You now have a working Kubernetes cluster on Windows.
sudo apt update
sudo apt install -y curl apt-transport-https
sudo apt install -y docker.io
curl -LO "https://dl.k8s.io/release/$(curl -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start --driver=docker
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install kubectl
brew install minikube
minikube start --driver=docker
Run:
kubectl get nodes
If you see minikube Ready, congratulations π β your first Kubernetes cluster is alive!
Deploy a simple app:
kubectl create deployment hello-k8s --image=nginx
kubectl expose deployment hello-k8s --type=NodePort --port=80
minikube service hello-k8s
You should see Nginx welcome page in your browser. Boom β you just deployed your first app with Kubernetes! π
kubectl scale deployment hello-k8s --replicas=3
minikube dashboard
Kubernetes can look intimidating at first, but once you break it down, itβs like playing Lego with containers. Start small with Minikube, deploy simple apps, and gradually explore advanced concepts like Ingress, ConfigMaps, and StatefulSets.
Stay tuned for my next blog.