# yvosonthehub/labnetapp architecture

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

- Interactive diagram: https://gitdiagram.com/yvosonthehub/labnetapp
- Repository: https://github.com/yvosonthehub/labnetapp

## Overview

The LabNetApp project is a “lab” repository designed to help engineers and administrators learn about and experiment with NetApp’s Trident integration into Kubernetes clusters. It is not a production application per se; rather, it is a collection of labs (scenarios) that work across multiple Kubernetes versions (from v1 pre-CSI up to v6 with advanced CSI features) and that include both dynamic storage provisioning labs and application data protection (Trident Protect) use cases.

##### Main Components
- Kubernetes Cluster(s): Represented in the various “Kubernetes_v*” directories. Each version (v1, v2, v4, v5, v6) shows different labs and scenarios configured with appropriate Kubernetes manifests (pvc, pod, deployments, service definitions, etc.).
- Backend Storage Systems (ONTAP, SolidFire, etc.): Since the labs demonstrate dynamic provisioning for both NAS and SAN types, include representations of the physical storage backend (such as ONTAP) that works with Trident.
- Lab/Exercise Scripts and Supporting Tools: Although not a “runtime” component, the repository includes “Addendum” folders and command scripts (e.g., all_in_one.sh, upgrade scripts, ArgoCD configurations, and HAProxy and dashboard setups) that prepare the environment.
- Application Workloads: Several labs deploy sample applications such as Ghost, Apache, busybox, MySQL and others. These represent typical container applications that are used to test volume provisioning and performance.

##### Out Component Interactions
- How Trident communicates with the backend storage (e.g., ONTAP systems) and how it is used dynamically to provision, resize, or snapshot persistent volumes.
- When covering protection scenarios, include components like external monitoring/observability stacks (Prometheus, Grafana, Harvest) and GitOps tools (ArgoCD) that are integrated in some labs.
- For each lab scenario, annotate that there is a “scenario directory” that includes a set of YAML manifests, shell scripts, and configuration files that simulate a distinct environment workflow.

##### Architectural Patterns and Design Principles
- Modularity: The repository is segmented by Kubernetes version and further by “Scenarios” and “Addendum.” Each scenario is self-contained and has its own README file that explains the lab exercise.
- Extensibility: By including addendum folders and multiple versions, the project illustrates an evolutionary approach to lab design that supports testing upgrades, incorporating new features such as CSI snapshots, HAProxy configuration, and integration with GitOps tools.
- Infrastructure as Code: The vast collection of YAML files, shell scripts, and configuration files shows a strong emphasis on declarative configuration and automation in a lab environment.

##### Relevant Technologies, Frameworks, and Libraries
- Kubernetes – the container orchestration platform that is central to every lab.
- NetApp Trident – the CSI driver that integrates storage systems with Kubernetes.
- ONTAP (NAS/SAN) – the backend storage technology.
- CSI (Container Storage Interface) – the standard protocol between Kubernetes and storage drivers.
- Monitoring and DevOps tools such as Prometheus, Grafana, Harvest, ArgoCD, and even HAProxy which are part of some lab scenarios.
- Various sample applications (like Ghost, Apache, busybox) which serve as workload examples.

##### Additional Recommendations
- Flow “from the lab user’s terminal” (e.g., connecting via Putty to a host) to the control plane, which then triggers the lab scenario workflows.
- That the repository contains “scenario instructions” for each lab exercise, which are executed in dedicated directories.

## Diagram (Mermaid)

```mermaid
flowchart TD
    LabUser["Lab User Terminal"]:::user

    subgraph "Kubernetes Environment"
        K8s_Control["Kubernetes Control Plane"]:::k8s
        K8s_v1["v1"]:::k8s
        K8s_v2["v2"]:::k8s
        K8s_v4["v4"]:::k8s
        K8s_v5["v5"]:::k8s
        K8s_v6["v6"]:::k8s
        K8s_Control --> K8s_v1
        K8s_Control --> K8s_v2
        K8s_Control --> K8s_v4
        K8s_Control --> K8s_v5
        K8s_Control --> K8s_v6
    end

    Trident["Trident CSI Driver"]:::csi

    subgraph "Backend Storage Systems"
        ONTAP_NAS["ONTAP NAS Default"]:::storage
        ONTAP_NAS_Eco["ONTAP NAS Eco"]:::storage
        ONTAP_NAS_Flex["ONTAP NAS Flexgroup"]:::storage
        ONTAP_SAN["ONTAP SAN"]:::storage
        SolidFire["SolidFire"]:::storage
    end

    subgraph "Lab/Exercise Tools"
        K8s_Addendum_v2["K8s Addendum v2"]:::lab
        K8s_Addendum_v4["K8s Addendum v4"]:::lab
        K8s_Addendum_v5["K8s Addendum v5"]:::lab
        K8s_Addendum_v6["K8s Addendum v6"]:::lab
        All_in_one_v6["all_in_one_v6.sh"]:::lab
        All_in_one_v6_rhel5["all_in_one_v6_rhel5.sh"]:::lab
    end

    subgraph "Application Workloads"
        Apache["Apache"]:::app
        Ghost["Ghost"]:::app
        BusyBox["BusyBox"]:::app
        MySQL["MySQL"]:::app
    end

    Monitoring_GitOps["Monitoring & GitOps Tools"]:::monitor

    LabUser --> K8s_Control
    K8s_Control --> Trident

    Trident --> ONTAP_NAS
    Trident --> ONTAP_NAS_Eco
    Trident --> ONTAP_NAS_Flex
    Trident --> ONTAP_SAN
    Trident --> SolidFire

    K8s_Control --> K8s_Addendum_v2
    K8s_Control --> K8s_Addendum_v4
    K8s_Control --> K8s_Addendum_v5
    K8s_Control --> K8s_Addendum_v6
    K8s_Control --> All_in_one_v6
    K8s_Control --> All_in_one_v6_rhel5

    K8s_Control --> Apache
    K8s_Control --> Ghost
    K8s_Control --> BusyBox
    K8s_Control --> MySQL

    K8s_Control --> Monitoring_GitOps
    Trident --> Monitoring_GitOps

    %% Click Events for Kubernetes Cluster Simulations
    click K8s_v1 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v1"
    click K8s_v2 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v2"
    click K8s_v4 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v4"
    click K8s_v5 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v5"
    click K8s_v6 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v6"

    %% Click Event for Trident CSI Driver Integration
    click Trident "https://github.com/yvosonthehub/labnetapp/blob/master/Kubernetes_v1/sc-csi-ontap-nas.yaml"

    %% Click Events for Backend Storage Systems
    click ONTAP_NAS "https://github.com/yvosonthehub/labnetapp/blob/master/Docker/config-ontap-nas-default.json"
    click ONTAP_NAS_Eco "https://github.com/yvosonthehub/labnetapp/blob/master/Docker/config-ontap-nas-eco-default.json"
    click ONTAP_NAS_Flex "https://github.com/yvosonthehub/labnetapp/blob/master/Docker/config-ontap-nas-flexgroup-default.json"
    click ONTAP_SAN "https://github.com/yvosonthehub/labnetapp/blob/master/Docker/config-ontap-san-default.json"
    click SolidFire "https://github.com/yvosonthehub/labnetapp/tree/master/Docker/config-solidfire-default"

    %% Click Events for Lab/Exercise Scripts and Supporting Tools
    click K8s_Addendum_v2 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v2/Addendum"
    click K8s_Addendum_v4 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v4/Addendum"
    click K8s_Addendum_v5 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v5/Addendum"
    click K8s_Addendum_v6 "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v6/Addendum"
    click All_in_one_v6 "https://github.com/yvosonthehub/labnetapp/blob/master/all_in_one_v6.sh"
    click All_in_one_v6_rhel5 "https://github.com/yvosonthehub/labnetapp/blob/master/all_in_one_v6_rhel5.sh"

    %% Click Events for Application Workloads
    click Apache "https://github.com/yvosonthehub/labnetapp/tree/master/Docker/Apache"
    click Ghost "https://github.com/yvosonthehub/labnetapp/tree/master/Kubernetes_v4/Scenarios/Scenario04/Ghost"

    %% Styling Classes
    classDef user fill:#fceabb,stroke:#e8a317,stroke-width:2px;
    classDef k8s fill:#c7e9b4,stroke:#3a7d44,stroke-width:2px;
    classDef csi fill:#d0e1f9,stroke:#2a73cc,stroke-width:2px;
    classDef storage fill:#f9d0c4,stroke:#c94c4c,stroke-width:2px;
    classDef lab fill:#e3dffc,stroke:#7f58af,stroke-width:2px;
    classDef app fill:#ffe1a8,stroke:#e69500,stroke-width:2px;
    classDef monitor fill:#d4f0fc,stroke:#34a8d6,stroke-width:2px;
```
