# xiaopeng163/docker-k8s-lab architecture

> Architecture diagram of the GitHub repository xiaopeng163/docker-k8s-lab, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/xiaopeng163/docker-k8s-lab
- Repository: https://github.com/xiaopeng163/docker-k8s-lab

## Overview

##### Main Components

a. Documentation Layer
- ReadTheDocs documentation system
- Source RST files structure

b. Laboratory Components
- Docker Examples
- Kubernetes Examples
- Lab Environments

c. Code Examples
- Docker implementations
- Kubernetes implementations
- Infrastructure configurations

##### Specific Elements

a. Documentation Flow:
- How RST files are processed into documentation
- Source files to ReadTheDocs platform

b. Laboratory Structure:
- Single-node setups
- Multi-node configurations
- Different OS support (Ubuntu, CentOS)

c. Example Applications:
- Flask applications
- Redis integrations
- Load balancing scenarios
- MySQL replication

##### Key Relationships to Highlight

- How the lab environments connect to both Docker and Kubernetes examples
- Relationship between documentation and implementation
- Demonstrate how different examples relate to best practices

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef documentation fill:#3498db,stroke:#2980b9,color:white
    classDef docker fill:#2ecc71,stroke:#27ae60,color:white
    classDef kubernetes fill:#e67e22,stroke:#d35400,color:white
    classDef infrastructure fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef lab fill:#9b59b6,stroke:#8e44ad,color:white

    %% Documentation Layer
    subgraph Documentation
        ReadTheDocs["ReadTheDocs Platform"]:::documentation
        MainDocs["Main Documentation"]:::documentation
        SourceDocs["Source Documentation"]:::documentation
        DockerDocs["Docker Documentation"]:::documentation
        K8sDocs["Kubernetes Documentation"]:::documentation
    end

    %% Laboratory Layer
    subgraph Labs
        DockerLabs["Docker Labs"]:::lab
        K8sLabs["Kubernetes Labs"]:::lab
        PodmanLabs["Podman Labs"]:::lab
        SingleNode["Single-node Setups"]:::lab
        MultiNode["Multi-node Setups"]:::lab
    end

    %% Implementation Layer
    subgraph DockerExamples
        BestPractices["Docker Best Practices"]:::docker
        ComposeExamples["Docker Compose Examples"]:::docker
        FlaskRedis["Flask-Redis App"]:::docker
        HelloWorld["Hello World App"]:::docker
    end

    subgraph K8sExamples
        K8sFlaskRedis["K8s Flask-Redis"]:::kubernetes
        MySQLReplication["MySQL Replication"]:::kubernetes
    end

    subgraph Infrastructure
        Ubuntu18["Ubuntu 18.04"]:::infrastructure
        Ubuntu20["Ubuntu 20.04"]:::infrastructure
        CentOS7["CentOS 7"]:::infrastructure
        CentOS8["CentOS 8"]:::infrastructure
    end

    subgraph BestPracticesDetails
        ImageSelection["Image Selection"]:::docker
        CacheOpt["Cache Optimization"]:::docker
        MultiStage["Multi-stage Builds"]:::docker
        Security["Security (No Root)"]:::docker
        DockerfileEx["Dockerfile Examples"]:::docker
    end

    %% Relationships
    MainDocs --> SourceDocs
    SourceDocs --> DockerDocs
    SourceDocs --> K8sDocs
    DockerDocs --> ReadTheDocs
    K8sDocs --> ReadTheDocs

    DockerLabs --> SingleNode
    DockerLabs --> MultiNode
    SingleNode --> Infrastructure
    MultiNode --> Infrastructure

    BestPractices --> BestPracticesDetails
    DockerLabs --> DockerExamples
    K8sLabs --> K8sExamples

    %% Click Events
    click MainDocs "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/docs"
    click SourceDocs "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/docs/source"
    click DockerDocs "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/docs/source/docker"
    click K8sDocs "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/docs/source/kubernetes"
    click DockerLabs "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/lab/docker"
    click K8sLabs "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/lab/k8s"
    click PodmanLabs "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/lab/podman"
    click SingleNode "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/lab/docker/single-node"
    click MultiNode "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/lab/docker/multi-node"
    click BestPractices "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/best-practise"
    click ComposeExamples "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/docker-compose"
    click FlaskRedis "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/flask-redis"
    click HelloWorld "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/flask-hello-world"
    click K8sFlaskRedis "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/kubernetes/flask-redis"
    click MySQLReplication "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/kubernetes/mysql_replication"
    click Ubuntu18 "https://github.com/xiaopeng163/docker-k8s-lab/blob/master/lab/docker/single-node/vagrant-ubuntu18.04"
    click Ubuntu20 "https://github.com/xiaopeng163/docker-k8s-lab/blob/master/lab/docker/single-node/vagrant-ubuntu20.04"
    click CentOS7 "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/lab/docker/single-node/vagrant-centos7"
    click CentOS8 "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/lab/docker/single-node/vagrant-centos8"
    click ImageSelection "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/best-practise/1-how-to-chose-image"
    click CacheOpt "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/best-practise/2-build-with-cache"
    click MultiStage "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/best-practise/3-multi-stage-build"
    click Security "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/best-practise/6-no-root"
    click DockerfileEx "https://github.com/xiaopeng163/docker-k8s-lab/tree/master/code/docker/best-practise/7-good-bad-dockerfile"
```
