# danwahlin/dockerandkubernetescoursecode architecture

> Architecture diagram of the GitHub repository danwahlin/dockerandkubernetescoursecode, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/danwahlin/dockerandkubernetescoursecode
- Repository: https://github.com/danwahlin/dockerandkubernetescoursecode

## Overview

##### 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.

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Root
    CourseRepo["Course Repository"]:::code
    click CourseRepo "https://github.com/danwahlin/dockerandkubernetescoursecode/blob/main/README.md"

    %% Labs Module
    subgraph "Labs" 
        LabsModule["Labs"]:::code
        click LabsModule "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/labs/"
        subgraph "Monolith to Microservices (End)"
            direction TB
            subgraph "Container Layer"
                MonolithUI["Monolith UI (ASP.NET Core Docker Container)"]:::container
                click MonolithUI "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/labs/Monolith to Microservices/End/Microservices/MonolithToMicroservices/"
                CustomersAPI["Customers.API Service"]:::container
                click CustomersAPI "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/labs/Monolith to Microservices/End/Microservices/Services/Customers.API/"
                LookupAPI["Lookup.API Service"]:::container
                click LookupAPI "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/labs/Monolith to Microservices/End/Microservices/Services/Lookup.API/"
            end
            subgraph "Database Layer"
                CustomerDB["Customer DB (SQLite)"]:::database
                LookupDB["Lookup DB (SQLite)"]:::database
            end
            subgraph "Orchestration Layer"
                Compose["Docker Compose"]:::orchestration
                click Compose "https://github.com/danwahlin/dockerandkubernetescoursecode/blob/main/labs/Monolith to Microservices/End/Microservices/docker-compose.yml"
                K8sManifests["K8s Deployments & Services"]:::orchestration
                click K8sManifests "https://github.com/danwahlin/dockerandkubernetescoursecode/blob/main/labs/Monolith to Microservices/End/Microservices/.k8s/*.yaml"
            end
        end
    end

    %% Samples Module
    subgraph "Samples"
        SamplesModule["Samples"]:::code
        click SamplesModule "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/"
        BlueGreen["Blue-Green Deployment"]:::sample
        click BlueGreen "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/blue-green/"
        Canary["Canary Deployment"]:::sample
        click Canary "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/canary/"
        ConfigMapSample["ConfigMap Demo"]:::sample
        click ConfigMapSample "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/configMaps/"
        SecretsSample["Secrets Demo"]:::sample
        click SecretsSample "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/secrets/"
        RollingUpdate["Rolling Update Demo"]:::sample
        click RollingUpdate "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/rolling-update/"
        JobsSample["Jobs/CronJobs Demo"]:::sample
        click JobsSample "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/jobs/"
        MetricsServer["Metrics-Server Demo"]:::sample
        click MetricsServer "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/metrics-server/"
        Prometheus["Prometheus+Grafana Monitoring"]:::sample
        click Prometheus "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/prometheus/"
        ServiceTypes["Service Types Demo"]:::sample
        click ServiceTypes "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/services/"
        Volumes["Volumes Demo"]:::sample
        click Volumes "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/volumes/"
        ReplicaSets["ReplicaSet Liveness Probe"]:::sample
        click ReplicaSets "https://github.com/danwahlin/dockerandkubernetescoursecode/tree/main/samples/replicaSets/"
    end

    %% Relationships
    CourseRepo --> LabsModule
    CourseRepo --> SamplesModule

    MonolithUI -->|calls| CustomersAPI
    MonolithUI -->|calls| LookupAPI
    CustomersAPI -->|reads/writes| CustomerDB
    LookupAPI -->|reads/writes| LookupDB

    Compose --> MonolithUI
    Compose --> CustomersAPI
    Compose --> LookupAPI
    Compose --> CustomerDB
    Compose --> LookupDB

    K8sManifests --> MonolithUI
    K8sManifests --> CustomersAPI
    K8sManifests --> LookupAPI

    %% Styles
    classDef code fill:#f9f,stroke:#333,stroke-width:1px;
    classDef container fill:#bbf,stroke:#333,stroke-width:1px;
    classDef database fill:#bfb,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5;
    classDef orchestration fill:#ffb,stroke:#333,stroke-width:1px,stroke-dasharray: 2 2;
    classDef sample fill:#fbb,stroke:#333,stroke-width:1px;
```
