Kubernetes – 100+ Lab Exercises (Basic, Intermediate, Advanced)
🔰 Basic Level (30+ Exercises)
Goal: Learn foundational concepts, architecture, and core resources of Kubernetes.
Introduction to Kubernetes
Understand Kubernetes architecture (Master, Node, etcd, kubelet, kube-proxy).
Install Minikube and kubectl on local machine.
Start a Kubernetes cluster using Minikube.
Explore
kubectl get,describe,logs, andexec.View cluster nodes and pods.
Pods and Containers
Create a basic Pod using YAML.
Deploy a single-container Pod using CLI and YAML.
Check Pod status and logs.
Use
kubectl port-forwardto expose a pod.Create a multi-container Pod.
ReplicaSets and Deployments
Define and deploy a ReplicaSet.
Update ReplicaSet to scale pods.
Migrate ReplicaSet to Deployment.
Perform rolling updates and rollbacks.
Set resource requests and limits.
Services & Networking
Create a ClusterIP service for a pod.
Deploy a NodePort service.
Access services from within and outside the cluster.
Use labels and selectors for service discovery.
Test DNS resolution between pods.
🚀 Intermediate Level (40+ Exercises)
Goal: Dive into workload management, persistent storage, and Helm.
ConfigMaps & Secrets
Create ConfigMaps using YAML and CLI.
Inject environment variables via ConfigMaps.
Store credentials using Secrets.
Mount Secrets and ConfigMaps as volumes.
Use
kubectl describeto inspect Secrets.
Volumes & Storage
Mount a
hostPathvolume into a Pod.Use
emptyDir,configMap, andsecretvolumes.Create a PersistentVolume (PV).
Define and bind a PersistentVolumeClaim (PVC).
Use dynamic volume provisioning (e.g., with Minikube hostpath provisioner).
StatefulSets & DaemonSets
Deploy a StatefulSet with volume claims.
Create a headless service for StatefulSets.
Deploy a logging DaemonSet (e.g., Fluentd, Filebeat).
Understand pod identity and persistence in StatefulSets.
Scale StatefulSets and manage identity.
Ingress & TLS
Deploy an Nginx Ingress Controller.
Create Ingress rules for multiple services.
Enable TLS using self-signed certificate.
Test domain-based routing.
Configure backend service weights.
Helm (Package Manager)
Install Helm on local machine.
Add official Helm chart repositories.
Install a Helm chart (e.g., WordPress, Redis).
Override Helm values using
--set.Create a custom Helm chart.
🧠 Advanced Level (40+ Exercises)
Goal: Implement CI/CD, advanced networking, observability, and security at production scale.
Advanced Deployments
Implement Blue/Green deployments.
Use canary deployments with traffic splitting.
Create CronJobs and Jobs.
Configure pod affinity and anti-affinity.
Use taints, tolerations, and node selectors.
Observability & Monitoring
Install Prometheus and Grafana via Helm.
Configure pod metrics scraping.
Create custom Grafana dashboards.
Monitor pod logs with EFK stack (Elasticsearch, Fluentd, Kibana).
Set up alerting rules in Prometheus.
Security & RBAC
Create Kubernetes Roles and RoleBindings.
Apply ServiceAccount to a pod.
Use NetworkPolicies to restrict traffic.
Enable PodSecurity admission policies.
Scan workloads for vulnerabilities using tools like Kube-Bench or Trivy.
CI/CD & GitOps
Deploy Argo CD for GitOps.
Set up Jenkins pipelines with Kubernetes agents.
Deploy using GitHub Actions into a cluster.
Configure webhooks for auto-deployment.
Automate Helm releases via Flux.
Cluster Operations
Backup and restore etcd data.
Upgrade Kubernetes cluster (Minikube/Kubeadm).
Drain, cordon, and uncordon cluster nodes.
Scale node pools (e.g., with Karpenter or Cluster Autoscaler).
Audit API server activity logs.
Capstone Projects
Deploy a multi-service microservices architecture.
Secure and monitor a production-grade web app.
Implement cost-optimized auto-scaling for traffic spikes.
Migrate workloads from Docker Compose to Kubernetes.
Build an internal developer platform using Helm and Ingress.
✅ Tools & Technologies
kubectl, Minikube, Kubeadm, k3s, KindHelm, Prometheus, Grafana, K9s
Argo CD, Flux, Jenkins, GitHub Actions
Linkerd, Istio, Kiali, KubeLens
Trivy, Kube-Bench, OPA Gatekeeper
