How danwahlin/dockerandkubernetescoursecode works
Project Type and Purpose
• This repository is an educational “Docker and Kubernetes Course” containing:
• Labs: step-by-step exercises (each under labs/…) demonstrating container and Kubernetes concepts.
• Samples: standalone YAML and code examples (under samples/…) illustrating real-world patterns (blue-green, canary, config maps, secrets, etc.).
• It is not a single deployable application but a curated collection of micro-projects and manifests for teaching container orchestration.
File Structure Analysis
• Top-level folders:
• labs/ – Organized by topic (Getting Started, Monolith to Microservices, Orchestrating with Compose, Working with AKS/Pods/Services, Volumes-ConfigMaps-Secrets, Updates & Deployments, etc.). Each lab often has a “Begin” and “End” subfolder showing before/after states.
• samples/ – Dozens of smaller examples of Kubernetes resources and deployment patterns (deployments, services, pods, configMaps, secrets, cronjobs, dashboards, monitoring).
• README.md – Course overview and links.
• Within each lab:
• Code projects (ASP.NET Core, Node.js, Angular) with Dockerfile(s), docker-compose.yml, .k8s manifests.
• “Services” subfolders showcase microservices (e.g., Customers.API, Lookup.API) with their own Controllers, Repositories, appsettings, Dockerfiles.
• Configuration and volume mounts (.docker/config, .k8s/*.yaml).
• Patterns:
• Monolith → Microservices refactoring (UI + two APIs).
• Multi-container orchestration via Docker Compose.
• Kubernetes primitives: Pod, Deployment, Service, ConfigMap, Secret, Volume, RollingUpdate, Blue/Green, Canary.
Key Insights from README
• The repository supports a video course on Docker & Kubernetes by Code with Dan.
• No single master architecture; the goal is to illustrate modular, evolving containerized architectures.
a. Main Components
• Course Repository (root).
• Two top-level modules: Labs and Samples.
• Within Labs: named exercises (Getting Started, Monolith to Microservices, Compose, Pods, Services, Volumes/ConfigMaps/Secrets, Updates & Deployments).
• Within each exercise: code artifacts (monolith UI, microservices, Node apps), Docker layer (Dockerfiles, Compose files), Kubernetes layer (YAML manifests).
b. Relationships and Interactions
• Progression: “Begin” code → “End” code for each lab.
• For Monolith to Microservices: UI calls Customers.API and Lookup.API; both access their own databases.
• For Compose labs: Client (Angular or web UI) ↔ API containers ↔ DB containers.
• Kubernetes labs: YAML defines how Pods, Services, ConfigMaps, Secrets, Volumes connect.
c. Architectural Patterns and Principles
• Layered abstraction: Code → Container → Orchestration (Compose/Kubernetes).
• Microservices decomposition with service contracts (API controllers, settings interfaces).
• Infrastructure as code: Docker Compose and Kubernetes manifests alongside code.
• Deployment strategies: Blue/Green, Rolling Updates, Canary.
d. Relevant Technologies
• Languages/Frameworks: C# / ASP.NET Core MVC & Razor, Node.js/Express, Angular.
• Containerization: Dockerfile, docker-compose.yml.
• Orchestration: Kubernetes manifests (.k8s/*.yaml), kubectl commands.
• Data stores: SQLite (single-file DB), PostgreSQL, MongoDB, Redis.
Summary
• Both the hierarchical structure (Labs vs. Samples) and the typical multi-service topology within each lab.
• Don’t overcomplicate: treat each exercise as a micro-architecture and the repo as a composable library of those micro-architectures.