This repository contains hands-on Kubernetes training materials organized as a structured course. Each topic is covered in its own lab directory under labs/, with the content hosted at https://kubernetes.courselabs.co.
labs/- Core training modules (30+ topics covering all aspects of Kubernetes)hackathon/- End-to-end project demonstrating real-world application deploymentsetup/- Environment setup instructions and configurationsscripts/- Utility scripts for image management and environment setupimg/- Screenshots and diagrams referenced in the labs
Each lab follows a consistent structure:
README.md- Main tutorial with step-by-step instructionshints.md- Additional guidance for exercisessolution.md- Complete solutions to lab exercisesspecs/- Directory containing YAML manifests and configurationssolution/- Directory with solution files for lab exercises
- pods - Basic Pod concepts, creating and managing containers
- services - Networking Pods with Services (ClusterIP, NodePort, LoadBalancer)
- deployments - Managing application deployments and scaling
- configmaps - Configuration management
- secrets - Secure configuration data management
- persistentvolumes - Volume management and persistent storage
- statefulsets - Stateful application deployments
- ingress - HTTP/HTTPS routing and load balancing
- networkpolicy - Network security and segmentation
- rbac - Role-Based Access Control and security
- helm - Package management with Helm charts
- kustomize - Configuration management without templates
- operators - Custom resource definitions and operators
- monitoring - Prometheus and Grafana setup
- logging - Centralized logging with ELK stack
- jenkins - CI/CD pipeline setup
- argo - GitOps with ArgoCD
- buildkit - Container image building in cluster
- productionizing - Health checks, resource limits, autoscaling
- troubleshooting - Debugging techniques and best practices
- admission - Admission controllers and policy enforcement
# Check YAML syntax (if yamllint is available)
find labs/ -name "*.yaml" -exec yamllint {} \;
# Validate Kubernetes manifests (requires cluster access)
kubectl apply --dry-run=client -f labs/<topic>/specs/# Deploy a lab's specs
kubectl apply -f labs/<topic>/specs/
# Clean up lab resources (each lab has cleanup instructions)
kubectl delete pod,svc,deployment -l kubernetes.courselabs.co=<topic># Pull images for offline use
./scripts/pull-images.sh
# Sync images to registry
./scripts/imageSync.ps1 # Windows- Introduction - Brief overview of the topic
- API specs - Links to official Kubernetes documentation
- YAML overview - Collapsible detailed explanation of resource specs
- Step-by-step exercises - Hands-on tasks with kubectl commands
- Lab challenge - Independent exercise to reinforce learning
- Cleanup - Commands to remove created resources
- whoami - Simple web service for networking demos
- sleep - Basic pod for testing and troubleshooting
- nginx - Web server for ingress and service examples
- pi - CPU-intensive app for resource management examples
The labs support multiple Kubernetes distributions:
- Docker Desktop (recommended for local development)
- K3s/K3d
- Minikube
- Kind
- Cloud providers (AKS, EKS, GKE)
- Always check the existing structure before suggesting changes
- Maintain consistency with existing lab formats and patterns
- Test configurations against multiple Kubernetes distributions when possible
- Follow the cleanup pattern - every lab should have clear resource cleanup
- Use standard labels - labs use
kubernetes.courselabs.co=<topic>for easy cleanup - Reference official docs - always link to canonical Kubernetes documentation
# Check cluster status
kubectl get nodes
kubectl get pods --all-namespaces
# Debug pod issues
kubectl describe pod <pod-name>
kubectl logs <pod-name>
# Check resource usage
kubectl top nodes
kubectl top pods
# Validate YAML
kubectl apply --dry-run=client -f <file>The repository includes a custom VS Code extension for automated lab testing:
- Path:
src/lab-test-harness/ - Version: 1.7.3
- Purpose: Execute code blocks from lab README files in VS Code terminals
- Automatic Execution: Runs PowerShell and container code blocks from lab READMEs
- Smart Error Detection: Only executes PowerShell/container blocks, skips bash/YAML reference blocks
- Failure Handling: Comments with
# this_will_failor# this_could_failmark expected failures - kubectl exec Support: Handles interactive and non-interactive container execution properly
- Cleanup Control: Optional cleanup execution (defaults to skip for learning)
- Error Tracking: Creates TODO.md files for unexpected command failures
cd src/lab-test-harness
./install-extension.ps1- Command Palette:
Lab: Run Lab Test Harness - Select Lab: Choose from discovered labs or auto-detect current location
- Choose Cleanup: Skip cleanup (recommended) or run cleanup commands
- Automatic Execution: Extension runs all code blocks with 1s delays
- Stop Anytime:
Ctrl+Shift+Escapeto halt execution
- PowerShell blocks (````powershell`): Full execution with error tracking
- Container blocks (````container`): Execute as-is without PowerShell wrapping
- kubectl exec commands: No error checking (container context)
- Expected failures: Mark with
# this_will_failor# this_could_failcomments
| Command | Keybinding | Description |
|---|---|---|
Lab: Run Lab Test Harness |
- | Run complete lab or selected parts |
Lab: Run Selected Code Block |
Ctrl+Shift+Enter |
Execute code block at cursor |
Lab: Stop Lab Execution |
Ctrl+Shift+Escape |
Stop currently running execution |
- TODO.md Creation: Automatic generation when commands fail unexpectedly
- Immediate Updates: Files created as soon as errors occur (survives cancellation)
- Manual Review: Extension provides guidance on verifying ❌/✅ indicators
- Expected Failures: Commands with failure markers are ignored
- Single Terminal: Uses one terminal per lab execution
- Working Directory: Always starts from repository root for relative paths
- Window Management: Closes all editors and opens README in preview mode
- Version Tracking: Displays version number during installation
- Default branch:
main - Current branch:
updates-2507 - All changes should maintain backward compatibility
- Lab solutions should work on the minimum supported Kubernetes version
- Screenshots and images are stored in
img/directory