Skip to content

Kubernetes Learning Project

A hands-on project to learn Kubernetes, CI/CD, Terraform, and cloud-native infrastructure.


Goal

Build and deploy a simple multi-service application through a complete DevOps pipeline: - Local development with Docker - Kubernetes orchestration - Infrastructure as Code with Terraform - CI/CD automation - Observability and monitoring


Project Phases

Phase 1: Local Docker Setup

Objective: Get comfortable with containerization basics.

  • Create a simple app (e.g., Python Flask API + Redis)
  • Write Dockerfiles for each service
  • Create docker-compose.yml for local development
  • Understand networking between containers
  • Practice building, tagging, pushing images

Deliverable: Working multi-container app running locally.


Phase 2: Kubernetes Fundamentals (Local)

Objective: Learn core K8s concepts using a local cluster.

Setup options (pick one): - minikube - single-node cluster, good for learning - kind (Kubernetes in Docker) - lightweight, fast - k3d (k3s in Docker) - lightweight k3s wrapper

Concepts to learn: - [ ] Pods, ReplicaSets, Deployments - [ ] Services (ClusterIP, NodePort, LoadBalancer) - [ ] ConfigMaps and Secrets - [ ] Namespaces - [ ] Labels and Selectors - [ ] Persistent Volumes and Claims - [ ] Ingress controllers

Exercises: - [ ] Deploy app manually with kubectl - [ ] Write YAML manifests from scratch - [ ] Scale deployments up/down - [ ] Perform rolling updates - [ ] Debug failing pods (logs, exec, describe)

Deliverable: App running on local K8s with proper manifests.


Phase 3: Helm Charts

Objective: Package K8s applications properly.

  • Understand Helm chart structure
  • Convert raw manifests to a Helm chart
  • Use values.yaml for configuration
  • Learn templating basics
  • Install/upgrade/rollback releases

Deliverable: Helm chart for the application.


Phase 4: CI/CD Pipeline

Objective: Automate build, test, and deploy.

Options (pick one): - GitHub Actions - free, well-integrated - GitLab CI - powerful, self-hostable - Jenkins - traditional, highly customizable - ArgoCD - GitOps-native for K8s

Pipeline stages: - [ ] Lint and test code - [ ] Build Docker images - [ ] Push to container registry - [ ] Deploy to K8s (dev environment) - [ ] Run integration tests - [ ] Promote to staging/prod

Deliverable: Working CI/CD pipeline with automated deployments.


Phase 5: Infrastructure as Code (Terraform)

Objective: Provision cloud infrastructure declaratively.

Learn: - [ ] Terraform basics (init, plan, apply, destroy) - [ ] State management (local vs remote backend) - [ ] Providers (AWS, or LocalStack for local testing) - [ ] Modules and reusability - [ ] Variables and outputs

Infrastructure to provision: - [ ] VPC and networking - [ ] EKS cluster (or use kind/minikube locally) - [ ] Container registry (ECR) - [ ] IAM roles and policies - [ ] S3 bucket for Terraform state

Deliverable: Terraform configs that provision a K8s cluster.


Phase 6: Cloud Deployment (AWS EKS)

Objective: Deploy to production-grade managed Kubernetes.

  • Provision EKS with Terraform
  • Configure kubectl for EKS
  • Set up AWS Load Balancer Controller
  • Configure external-dns for Route53
  • Set up cert-manager for TLS
  • Deploy application with Helm

Alternative (cost-free): - Use LocalStack to simulate AWS locally - Use DigitalOcean ($12/mo for small K8s cluster) - Use Linode/Vultr (similar pricing)

Deliverable: App running on cloud K8s with proper ingress.


Phase 7: Observability

Objective: Monitor, log, and trace the application.

Stack options: - Prometheus + Grafana - metrics and dashboards - Loki - log aggregation - Jaeger/Tempo - distributed tracing - Or: Datadog, New Relic (SaaS options)

  • Deploy Prometheus with Helm
  • Create Grafana dashboards
  • Set up alerting rules
  • Centralize logs
  • Add application metrics

Deliverable: Observability stack with meaningful dashboards.


Phase 8: Advanced Topics (Optional)

Objective: Deepen K8s knowledge.

  • Network Policies
  • Pod Security Standards
  • Resource quotas and limits
  • Horizontal Pod Autoscaler (HPA)
  • Vertical Pod Autoscaler (VPA)
  • Service Mesh (Istio or Linkerd)
  • GitOps with ArgoCD or Flux
  • Secrets management (External Secrets, Vault)
  • Multi-cluster management

Suggested Application

A simple but realistic app to deploy:

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Frontend  │────▶│   Backend   │────▶│   Database  │
│   (nginx)   │     │   (Python)  │     │   (Redis)   │
└─────────────┘     └─────────────┘     └─────────────┘
  • Frontend: Static site or simple React app
  • Backend: REST API (Flask/FastAPI)
  • Database: Redis or PostgreSQL

This gives you: - Multiple services to orchestrate - Service-to-service communication - Stateful workload (database) - Ingress routing


Directory Structure (Planned)

k8s-learning/
├── PLAN.md                 # This file
├── app/
   ├── frontend/
      └── Dockerfile
   ├── backend/
      └── Dockerfile
   └── docker-compose.yml
├── k8s/
   ├── base/               # Raw manifests
   └── helm/               # Helm chart
├── terraform/
   ├── local/              # LocalStack/local testing
   └── aws/                # EKS infrastructure
├── ci/
   └── .github/workflows/  # GitHub Actions
└── docs/
    └── notes.md            # Learning notes

Resources

Official Documentation

Tutorials

Practice


Time Estimate

Phase Estimated Effort
Phase 1: Docker 1-2 days
Phase 2: K8s Fundamentals 1-2 weeks
Phase 3: Helm 2-3 days
Phase 4: CI/CD 3-5 days
Phase 5: Terraform 1 week
Phase 6: Cloud Deploy 3-5 days
Phase 7: Observability 3-5 days
Phase 8: Advanced Ongoing

Next Steps

  1. Choose local K8s tool (recommend: kind or minikube)
  2. Start Phase 1: build a simple containerized app
  3. Document learnings in docs/notes.md