This repository contains comprehensive documentation and configuration files for 5 hands-on Kubernetes labs covering fundamental to advanced concepts. The labs progress from basic pod operations to advanced scheduling and ingress configurations.
- Concepts: Pods, ReplicaSets, Deployments
- Key Files:
nginx.yaml
- Basic nginx podreplica-set-1.yaml
- Busybox ReplicaSetdeployment-1.yaml
- Basic deploymentnginx-deployment.yaml
- Production deployment
- Skills Gained:
- ✅ Imperative vs declarative management
- ✅ Self-healing capabilities
- ✅ Deployment strategies
- ✅ Rollback operations
- Concepts: Namespaces, Resource Management, Node Affinity
- Key Files:
finance-deployment.yaml
- Namespaced deploymenttaint.yaml
- Node affinity configuration
- Skills Gained:
- ✅ Namespace isolation
- ✅ Resource quotas
- ✅ Node selection
- ✅ Taints/tolerations
- Concepts: DaemonSets, Services, Networking
- Key Files:
fluentd-daemonset.yaml
- Cluster loggingbackend-service.yaml
- Service exposureweb-app-service.yaml
- NodePort service
- Skills Gained:
- ✅ Cluster-wide deployments
- ✅ Service discovery
- ✅ Internal/external access patterns
- ✅ Pod networking
- Concepts: ConfigMaps, Secrets, PVCs, Multi-container Pods
- Key Files:
darkblue-config.yaml
- ConfigMap exampledb-secret.yaml
- Secret managementpvc-log.yaml
- Persistent storagemulti-container-yellow.yaml
- Sidecar pattern
- Skills Gained:
- ✅ Configuration management
- ✅ Sensitive data handling
- ✅ Persistent storage
- ✅ Pod design patterns
- Concepts: Ingress, RBAC, Backend Services
- Key Files:
frontend-deployment.yaml
- HAProxy ingressClusterRole.yaml
- RBAC permissionsbackend-service.yaml
- Default backend
- Skills Gained:
- ✅ Ingress controller setup
- ✅ Role-based access control
- ✅ Default backend configuration
- ✅ TLS termination
# Clone the repository
git clone https://github.com/your-repo/kubernetes-labs.git
cd kubernetes-labs
# Set up cluster (Minikube)
minikube start
# Deploy all lab resources
kubectl apply -f lab1/
kubectl apply -f lab2/
kubectl apply -f lab3/
kubectl apply -f lab4/
kubectl apply -f lab5/
🧰 Common Operations
# Get cluster state
kubectl get all --all-namespaces
# Check specific resources
kubectl get [pods|services|deployments] -n [namespace]
# View detailed info
kubectl describe [resource] [name]
Deployment Management
# Apply configurations
kubectl apply -f [file.yaml]
# Scale deployments
kubectl scale deployment/[name] --replicas=[number]
# Update images
kubectl set image deployment/[name] [container]=[image]
# Rollback changes
kubectl rollout undo deployment/[name]
kubectl logs [pod-name] -c [container]
kubectl describe pod [pod-name]
kubectl port-forward svc/[service-name] [local-port]:[service-port]
📊 Architecture Diagrams Ingress Controller Flow (Lab 5) Internet → NodePort (32456/32567) → HAProxy Ingress → Backend Services → Application Pods
Persistent Storage Flow (Lab 4) Application Pod → PVC → PV → Host Path (/pv/log)
🏆 Best Practices Resource Management:
Always set requests/limits (Lab 2)
Use namespaces for isolation (Lab 2)
Configuration:
Use ConfigMaps for settings (Lab 4)
Store secrets properly (Lab 4)
Availability:
Use multiple replicas (Lab 1)
Implement proper probes (Lab 5)
Security:
Apply least privilege RBAC (Lab 5)
Use network policies