If Docker helps you run one or two containers, Kubernetes helps you manage hundreds — across multiple servers, automatically. It’s the backbone of modern cloud platforms like Google Cloud, AWS, and Azure.
In this post, you’ll learn the fundamentals of Kubernetes (K8s) — how to host, scale, and maintain containerized apps using YAML manifests and a simple cluster setup.
See Also: How to Set Up a Complete CI/CD Pipeline with Jenkins (Automated Website Deployment Tutorial)
What Is Kubernetes?
Kubernetes (often called K8s) is an open-source orchestration system for managing containers at scale.
It handles:
- Automatic deployment and scaling
- Load balancing
- Self-healing containers (restart if one fails)
- Rolling updates and version control
In short, Kubernetes automates everything Docker can’t do alone.
Step 1: Install Kubernetes Locally (Minikube)
The easiest way to get started is with Minikube, a local Kubernetes cluster.
Install dependencies:
sudo apt install docker.io curl -y
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikubeStart your local cluster:
minikube startStep 2: Create a Deployment
A Deployment defines how your containers run and update.
Create a file named deployment.yaml:
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-app
spec:
replicas: 3
selector:
matchLabels:
app: my-app
template:
metadata:
labels:
app: my-app
spec:
containers:
- name: my-app-container
image: your-dockerhub-username/my-app:latest
ports:
- containerPort: 80Apply it:
kubectl apply -f deployment.yamlThis creates 3 running instances (pods) of your container.
See Also: How to Set Up Automated Website Deployment with GitHub Actions (Complete CI/CD Tutorial)
Step 3: Expose the Deployment (Service)
Kubernetes services let your app be accessible to users.
Create a service.yaml:
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
selector:
app: my-app
ports:
- port: 80
targetPort: 80
nodePort: 30007Apply it:
kubectl apply -f service.yamlNow, open your app:
minikube service my-serviceStep 4: Scaling the App
Need to handle more traffic? Scale replicas easily:
kubectl scale deployment my-app --replicas=5Kubernetes automatically creates two more containers.
Step 5: Rolling Updates
When you push a new image to Docker Hub, update Kubernetes:
kubectl set image deployment/my-app my-app-container=your-dockerhub-username/my-app:v2It’ll gradually replace old containers with new ones — with zero downtime.
See Also: How to Deploy Containerized Apps with Docker Compose (Step-by-Step Guide)
Step 6: Deploying on the Cloud
You can deploy the same YAML files on:
- Google Kubernetes Engine (GKE)
- AWS EKS
- Azure AKS
Each provider offers a managed control plane, so you only worry about your workloads — not server maintenance.
Step 7: Add Ingress and HTTPS
Use an Ingress Controller (like NGINX Ingress) to route traffic and add HTTPS with Let’s Encrypt. Example manifest:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- host: mywebsite.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-service
port:
number: 80Step 8: Monitor and Manage
Monitor running pods and deployments:
kubectl get pods
kubectl get deployments
kubectl get servicesView logs:
kubectl logs <pod-name>Delete everything when done:
kubectl delete all --allConclusion
Kubernetes is the next step in mastering hosting and DevOps.
It takes the power of Docker and adds automation, scalability, and reliability — perfect for modern production apps.
In the next Hosting Academy post, we’ll explore Continuous Deployment with GitLab CI/CD and how it compares to GitHub Actions and Jenkins.

