# ashishagarwal143/openshift-march-2025 architecture

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

- Interactive diagram: https://gitdiagram.com/ashishagarwal143/openshift-march-2025
- Repository: https://github.com/ashishagarwal143/openshift-march-2025

## Overview

##### Project type and purpose
- This repository is a set of end-to-end hands-on labs for learning Red Hat OpenShift. Each “DayX” folder contains independent Kubernetes/OpenShift exercises: from simple static sites (Day2), to manifests for WordPress+MariaDB (Day7), Ingress (Day8), and a Java “Hello” microservice with Dockerfile, Deployment, Service and Route (Day9/Day10).

##### File structure
- Top-level folders Day1…Day10 each contain a README and one or more demos.
- “hello” subfolders in Day9 and Day10 hold a Java app (src/main/java/org/tektutor…), a Dockerfile and OpenShift YAML (Deployment, Service, Route).
- Day7/declarative-manifest-scripts demonstrates persistent volumes (PV), PVC, ConfigMaps, Secrets, Services and Deployments for MariaDB and WordPress.
- Day8/ingress shows an Ingress resource plus backend and ingress-controller Deployments/Services.
- Day2/lb is a static HTML demo behind an NGINX Deployment/Service.

##### Extract additional insights from the README
- The course is about installing and using OpenShift Local.
- No single monolithic app—each day is a standalone scenario illustrating a key Kubernetes/OpenShift concept.

a. Main components
- Developer workstation (source code, YAML manifests)
- Build system (local Docker-or-S2I build → container registry)
- OpenShift cluster
– Control plane (API Server, etcd, Controller Manager)
– Worker nodes (Kubelet, CRI-O)
- Workloads (per-day demos):
– Static site (NGINX Deployment + Service)
– Java Hello microservice (Deployment, Service, Route)
– Ingress controller + Ingress + Hello backend
– WordPress + MariaDB (Deployments, Services, PV/PVC, ConfigMap, Secret)
- External users & HTTP clients

b. Relationships and interactions
– Developer pushes code/manifests → local build → container image → image registry
– OpenShift pulls image → schedules Pods on nodes
– Services provide in-cluster discovery; Routes/Ingress expose HTTP(S) externally
– PV/PVC attach storage to database pods; ConfigMaps and Secrets inject configuration

c. Architectural patterns and design principles
– Immutable container images built from source (Dockerfile/S2I)
– Declarative YAML manifests for all resources (Infrastructure as Code)
– Logical separation: control plane vs. worker plane; frontend vs. backend vs. data store
– Use of Kubernetes primitives (Deployment, Service, Ingress, PV/PVC, ConfigMap, Secret)

d. Key technologies/frameworks
– OpenShift Local / OKD
– Kubernetes API objects (Deployment, Service, Route/Ingress, PVC, Secret, ConfigMap)
– Docker/S2I builds, container registry
– Java Spring-boot (HelloController), NGINX, MariaDB, WordPress

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Entities
    Developer["Developer Workstation"]:::external
    Build["Build System (Docker/S2I)"]:::external
    Registry["Container Registry"]:::external
    Client["External HTTP Client"]:::external

    %% Build Pipeline
    Developer -->|"build/push"| Build
    Build -->|"push image"| Registry
    Registry -->|"pull image"| Cluster

    %% OpenShift Cluster
    subgraph "OpenShift Cluster"
        direction TB
        subgraph "Control Plane"
            direction TB
            APIServer["API Server"]:::control
            Etcd["etcd"]:::control
            Controller["Controller Manager"]:::control
        end

        subgraph "Worker Nodes"
            direction TB

            subgraph "Node1 (Day2 Static Site)" 
                direction TB
                NginxDep["NGINX Deployment"]:::worker
                NginxSvc["NGINX Service"]:::worker
                Index["index.html"]:::worker
                NginxCfg["nginx.conf"]:::worker
            end

            subgraph "Node2 (Day7 WordPress Stack)"
                direction TB
                PV["MariaDB PV & WordPress PV"]:::storage
                PVC["MariaDB PVC & WordPress PVC"]:::storage
                ConfigMapWP["WordPress ConfigMap"]:::config
                SecretWP["WordPress Secret"]:::config
                MariaDep["MariaDB Deployment"]:::worker
                MariaSvc["MariaDB Service"]:::worker
                WPDep["WordPress Deployment"]:::worker
                WPSvc["WordPress Service"]:::worker
                WPRoute["WordPress Route"]:::worker
                DeployScript["deploy.sh"]:::config
                UndeployScript["undeploy.sh"]:::config
            end

            subgraph "Node3 (Day8 Ingress)"
                direction TB
                IngressCtrDep["Ingress Controller Deployment"]:::worker
                IngressCtrSvc["Ingress Controller Service"]:::worker
                IngressRes["Ingress Resource"]:::worker
                IngressHelloDep["Hello Backend Deployment"]:::worker
                IngressHelloSvc["Hello Backend Service"]:::worker
                IngressNginxDep["NGINX Backend Deployment"]:::worker
                IngressNginxSvc["NGINX Backend Service"]:::worker
            end

            subgraph "Node4 (Day9 Hello Microservice)"
                direction TB
                Hello9Src["Hello Source Code"]:::worker
                Hello9Docker["Hello Dockerfile"]:::worker
                Hello9Dep["Hello Deployment"]:::worker
                Hello9Svc["Hello Service"]:::worker
                Hello9Route["Hello Route"]:::worker
            end

            subgraph "Node5 (Day10 Hello Microservice)"
                direction TB
                Hello10Src["Hello Source Code"]:::worker
                Hello10Docker["Hello Dockerfile"]:::worker
                Hello10Dep["Hello Deployment"]:::worker
                Hello10Svc["Hello Service"]:::worker
                Hello10Route["Hello Route"]:::worker
            end
        end
    end

    %% Network Flows
    Client -->|"HTTP"| WPRoute
    Client -->|"HTTP"| Hello9Route
    Client -->|"HTTP"| Hello10Route
    Client -->|"HTTP"| IngressRes
    IngressRes -->|"routes to"| IngressHelloSvc
    IngressRes -->|"routes to"| IngressNginxSvc

    %% Storage & Config
    MariaDep -->|"mounts"| PVC
    WPDep -->|"mounts"| PVC
    MariaDep -->|"uses"| ConfigMapWP
    WPDep -->|"uses"| ConfigMapWP
    WPDep -->|"uses"| SecretWP

    %% Click Events Day2
    click Index "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day2/lb/index.html"
    click NginxCfg "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day2/lb/nginx.conf"

    %% Click Events Day7
    click PV "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/mariadb-pv.yml"
    click PVC "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/mariadb-pvc.yml"
    click MariaDep "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/mariadb-deploy.yml"
    click MariaSvc "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/mariadb-service.yml"
    click WPDep "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/wordpress-deploy.yml"
    click WPSvc "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/wordpress-service.yml"
    click WPRoute "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/wordpress-route.yml"
    click ConfigMapWP "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/wordpress-configmap.yml"
    click SecretWP "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/wordpress-secrets.yml"
    click DeployScript "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/deploy.sh"
    click UndeployScript "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day7/declarative-manifest-scripts/undeploy.sh"

    %% Click Events Day8
    click IngressRes "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day8/ingress/ingress.yml"
    click IngressHelloDep "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day8/ingress/hello-deploy.yml"
    click IngressHelloSvc "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day8/ingress/hello-service.yml"
    click IngressNginxDep "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day8/ingress/nginx-deploy.yml"
    click IngressNginxSvc "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day8/ingress/nginx-service.yml"

    %% Click Events Day9
    click Hello9Src "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day9/hello/src/main/java/org/tektutor/HelloController.java"
    click Hello9Src "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day9/hello/src/main/java/org/tektutor/Main.java"
    click Hello9Docker "https://github.com/ashishagarwal143/openshift-march-2025/tree/main/Day9/hello/Dockerfile"
    click Hello9Dep "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day9/hello/hello-deploy.yml"
    click Hello9Svc "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day9/hello/hello-svc.yml"
    click Hello9Route "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day9/hello/hello-route.yml"
    click Hello9Src "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day9/hello/pom.xml"

    %% Click Events Day10
    click Hello10Src "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day10/hello/src/main/java/org/tektutor/HelloController.java"
    click Hello10Src "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day10/hello/src/main/java/org/tektutor/Main.java"
    click Hello10Docker "https://github.com/ashishagarwal143/openshift-march-2025/tree/main/Day10/hello/Dockerfile"
    click Hello10Dep "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day10/hello/hello-deploy.yml"
    click Hello10Svc "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day10/hello/hello-svc.yml"
    click Hello10Route "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day10/hello/hello-route.yml"
    click Hello10Src "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/Day10/hello/pom.xml"

    %% Click Events Registry
    click Registry "https://github.com/ashishagarwal143/openshift-march-2025/blob/main/README.md"

    %% Styles
    classDef control fill:#D4C2FC,stroke:#7D5BA6;
    classDef worker fill:#CDEBFF,stroke:#4A90E2;
    classDef storage fill:#C2FABC,stroke:#6AA84F;
    classDef config fill:#FAD2A1,stroke:#E69138;
    classDef external fill:#E2E2E2,stroke:#999999;
```
