# digicatapult/bridgeai-gitops-infra architecture

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

- Interactive diagram: https://gitdiagram.com/digicatapult/bridgeai-gitops-infra
- Repository: https://github.com/digicatapult/bridgeai-gitops-infra

## Overview

##### Main Components
- Source Repository: Represent the Git repository (this project) that holds all configuration manifests.
- Production Cluster (“bridgeai-prod”)
- Local “kind-cluster”
- Within each cluster, identify and represent the following sub-components:
- Base Configuration and Namespaces (under the “base” folder)
- Application deployments:
- Airflow (with associated ConfigMaps, certificates, volumes, ingress/nginx configurations)
- MLFlow (including its associated MinIO backend for artifacts)
- Prediction Service (with its certificate and ingress setup along with a REST API/Swagger interface)
- KServe for model serving (managed via CRDs)
- Cert-manager (for TLS and certificate management)
- Secrets Management: Represent secrets (e.g., credentials for Airflow, MLFlow, GitHub, DockerHub, etc.) that are stored and later applied via Flux.

##### Relationships and Interactions
- That changes committed to the Git repository trigger Flux to synchronize configuration changes to the clusters.
- That certificate management and secret synchronization are centrally controlled by their respective modules in Flux (e.g., cert-manager, secret-sync within the “base” folders).

##### Architectural Patterns and Design Principles
- GitOps Practice: Emphasize how the entire infrastructure is declaratively defined and managed through Git commits.
- Separation of Environments: Differentiate production (“bridgeai-prod”) and development (“kind-cluster”) environments.
- Microservice Configuration: Although the applications might be standalone components (e.g., Airflow and MLFlow), they are all configured for integration via Flux and Kubernetes resources.
- Security and Access Management: Certificate management (TLS via cert-manager), secrets, and ingress configurations are all highlighted and central to the deployment.

##### Relevant Technologies and Frameworks
- Kubernetes (with CRDs for KServe and flux-specific components)
- Flux (v2 – GitOps tool for continuous reconciliation)
- Docker, kind, kubectl (for cluster management and deployments)
- NGINX (as an ingress controller configured via Helm releases)
- MinIO (used both for MLFlow artifact storage and for DVC/Evidently data storage)

##### Specific Diagramic Elements
- Clear Labels: Each component should be clearly named (e.g., “Flux”, “bridgeai-prod Cluster”, “kind-cluster”, “Airflow”, “MLFlow”, “Prediction Service”, “KServe”, “Cert-manager”, “Secrets”).
- Annotations could differentiate production resources from development resources.

- Be very detailed. Even if it means breaking down the cluster into multiple subcomponents, capture elements such as namespaces, helm releases, configuration maps, and secrets.
- Special cases: how a KServe Inference Service is represented via CRDs or how external user access (via Swagger UI for Prediction Service or UI endpoints for Airflow/MLFlow) is routed through a common ingress (NGINX).
- Infrastructure flows that detail how external tools (kubectl, Docker, GitHub) interact with this system.

Using these guidelines, a principal software engineer can produce an accurate representation of the architecture, ensuring that the GitOps process, multi-cluster setups, and all critical deployment components are clearly visualized and understood.

## Diagram (Mermaid)

```mermaid
graph TD
    A["Source Repository"]:::repo
    B["GitOps Engine (Flux)"]:::flux
    C["Shared Configurations"]:::shared
    D["Support Scripts"]:::scripts

    A -->|"FluxSync"| B
    D -->|"setup"| A

    subgraph "bridgeai-prod Cluster"
        P1["Base Configuration"]:::cluster
        P2["Airflow Deployment"]:::app
        P3["MLFlow Deployment"]:::app
        P4["Prediction Service Deployment"]:::app
        P5["KServe Deployment"]:::app
        P6["Cert-manager"]:::cluster
        P7["Secrets Management"]:::cluster
    end

    subgraph "kind-cluster"
        K1["Base Configuration"]:::cluster
        K2["Cert-manager"]:::cluster
        K3["Environment Services"]:::app
        K4["MinIO"]:::app
        K5["NFS-Ganesha"]:::app
    end

    %% Flux directs deployments to clusters
    B -->|"Deploys"| P1
    B -->|"Deploys"| K1
    B -->|"Manages"| P6
    B -->|"Manages"| P7
    B -->|"Manages"| K2
    B -->|"AppliesShared"| C

    %% Production cluster internal dependencies
    P1 -->|"Configures"| P2
    P1 -->|"Configures"| P3
    P1 -->|"Configures"| P4
    P1 -->|"Configures"| P5
    C -->|"Supplies"| P2
    C -->|"Supplies"| P3
    C -->|"Supplies"| P4
    C -->|"Supplies"| P5

    %% kind-cluster internal dependencies
    K1 -->|"SetsUp"| K3
    K3 -->|"Includes"| K4
    K3 -->|"Includes"| K5

    %% Styles
    classDef repo fill:#b3d9ff,stroke:#333,stroke-width:2px;
    classDef flux fill:#ccffcc,stroke:#333,stroke-width:2px;
    classDef cluster fill:#ffd699,stroke:#333,stroke-width:2px;
    classDef app fill:#ffffcc,stroke:#333,stroke-width:2px;
    classDef shared fill:#e6e6e6,stroke:#333,stroke-width:2px;
    classDef scripts fill:#e6ccff,stroke:#333,stroke-width:2px;

    %% Click Events
    click A "https://github.com/digicatapult/bridgeai-gitops-infra/blob/main/README.md"
    click B "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux"
    click C "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/shared"
    click D "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/scripts"
    click P1 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/bridgeai-prod/base"
    click P2 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/bridgeai-prod/airflow"
    click P3 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/bridgeai-prod/mlflow"
    click P4 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/bridgeai-prod/prediction-service"
    click P5 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/bridgeai-prod/kserve"
    click P6 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/bridgeai-prod/cert-manager"
    click P7 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/bridgeai-prod/secrets"
    click K1 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/kind-cluster/base"
    click K2 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/kind-cluster/cert-manager"
    click K3 "https://github.com/digicatapult/bridgeai-gitops-infra/tree/main/flux/clusters/kind-cluster/env-services"
```
