Kubernetes Orchestration Basics: Complete Beginner Tutorial (2026 Edition)
Kubernetes Orchestration Basics: Complete Beginner Tutorial (2026 Edition)
Kubernetes (often abbreviated as K8s) is an open-source container orchestration platform that automates the deployment, scaling, and management of containerized applications. It was originally designed by Google and is now maintained by the Cloud Native Computing Foundation (CNCF).
This tutorial covers the fundamentals with practical examples, commands, and YAML configurations.

1. Why Kubernetes?
- Automation: Handles scaling, self-healing, load balancing, and rolling updates.
- Portability: Run the same setup on local machines, on-prem, or any cloud.
- High Availability: Distributes workloads across nodes.
- Ecosystem: Huge community with tools like Helm, Istio, Prometheus.
Key Difference from Docker: Docker runs individual containers. Kubernetes orchestrates many containers across multiple machines.
2. Core Kubernetes Concepts
Cluster
A Kubernetes cluster consists of:
- Control Plane (Master): Manages the cluster (API Server, Scheduler, Controller Manager, etcd).
- Worker Nodes: Run the actual workloads (Pods).
Pod
The smallest deployable unit. A Pod can contain one or more containers that share storage, network, and IP.
1# pod.yaml 2apiVersion: v1 3kind: Pod 4metadata: 5 name: nginx-pod 6spec: 7 containers: 8 - name: nginx 9 image: nginx:alpine 10 ports: 11 - containerPort: 80
Node
A physical or virtual machine in the cluster.
Deployment
Manages Pods with replicas, updates, and rollbacks.
1# deployment.yaml 2apiVersion: apps/v1 3kind: Deployment 4metadata: 5 name: nginx-deployment 6spec: 7 replicas: 3 8 selector: 9 matchLabels: 10 app: nginx 11 template: 12 metadata: 13 labels: 14 app: nginx 15 spec: 16 containers: 17 - name: nginx 18 image: nginx:alpine 19 ports: 20 - containerPort: 80
Service
Provides stable networking (ClusterIP, NodePort, LoadBalancer) to Pods.
1# service.yaml 2apiVersion: v1 3kind: Service 4metadata: 5 name: nginx-service 6spec: 7 selector: 8 app: nginx 9 ports: 10 - port: 80 11 targetPort: 80 12 type: NodePort
Other Important Objects
- Namespace: Logical partitioning.
- ConfigMap / Secret: Configuration and sensitive data.
- Volume: Persistent storage.
- Ingress: HTTP routing and TLS.
- StatefulSet / DaemonSet / Job: Specialized workloads.
3. Installation & Setup (Local Cluster with Minikube)
Prerequisites: Docker/Podman + 2+ CPUs, 2GB+ RAM.
1# Install Minikube (Linux example) 2curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 3sudo install minikube-linux-amd64 /usr/local/bin/minikube 4 5# Install kubectl 6curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" 7chmod +x kubectl && sudo mv kubectl /usr/local/bin/ 8 9# Start cluster 10minikube start --driver=docker
Verify:
1kubectl version 2kubectl get nodes 3minikube dashboard # Open web UI
4. Essential kubectl Commands
1# Cluster info 2kubectl cluster-info 3kubectl get nodes 4 5# Pods 6kubectl get pods 7kubectl get pods -o wide 8kubectl describe pod <name> 9kubectl logs <pod-name> 10kubectl exec -it <pod-name> -- sh 11 12# Deployments 13kubectl get deployments 14kubectl scale deployment nginx-deployment --replicas=5 15kubectl rollout status deployment/nginx-deployment 16kubectl rollout history deployment/nginx-deployment 17kubectl rollout undo deployment/nginx-deployment 18 19# Services 20kubectl get services 21kubectl get svc 22 23# Apply YAML 24kubectl apply -f deployment.yaml 25kubectl delete -f deployment.yaml 26 27# Useful shortcuts 28kubectl get all 29kubectl get pods --all-namespaces 30kubectl top pods # Resource usage
Common Flags:
-n namespace— Specify namespace-o yaml— Output as YAML--dry-run=client -o yaml— Preview without applying
5. Hands-On: Deploy a Sample Application
- Create Deployment
1kubectl create deployment nginx --image=nginx:alpine --replicas=3
- Expose as Service
1kubectl expose deployment nginx --port=80 --type=NodePort
- Access the app
1minikube service nginx # Opens in browser
Full YAML Workflow (recommended for production):
1kubectl apply -f https://k8s.io/examples/application/deployment.yaml
6. Scaling & Updates
1# Scale 2kubectl scale deployment/nginx --replicas=10 3 4# Update image (rolling update) 5kubectl set image deployment/nginx nginx=nginx:latest 6 7# Auto-scaling (Horizontal Pod Autoscaler) 8kubectl autoscale deployment nginx --min=2 --max=10 --cpu-percent=80
7. Basic YAML Best Practices
- Use
metadata.labelsandspec.selectorconsistently. - Add resource requests/limits:
1resources: 2 requests: 3 cpu: "100m" 4 memory: "128Mi" 5 limits: 6 cpu: "500m" 7 memory: "512Mi" - Use ConfigMaps for environment variables.
8. Architecture Overview (Simplified)
- etcd: Stores cluster state.
- API Server: Front-end for all operations.
- Scheduler: Assigns Pods to Nodes.
- Kubelet: Agent on each node that runs Pods.
- Kube-proxy: Handles networking.
9. Next Steps After Basics
- Namespaces & RBAC
- Helm for package management
- Persistent Volumes (PV/PVC)
- Ingress Controller (e.g., NGINX Ingress)
- Monitoring (Prometheus + Grafana)
- Move to production (EKS, GKE, AKS)
Practice Resources:
- Official Kubernetes Basics: https://kubernetes.io/docs/tutorials/kubernetes-basics/
- Katacoda / Play with Kubernetes (browser-based labs)
- Minikube + Kind for local testing
10. Troubleshooting Tips
1kubectl describe <resource> <name> 2kubectl logs <pod> -c <container> 3kubectl get events
Common Issues:
- ImagePullBackOff → Check image name & credentials.
- CrashLoopBackOff → Check container logs.
- Pending Pods → Insufficient resources on nodes.