# hughessystique/d-scope architecture

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

- Interactive diagram: https://gitdiagram.com/hughessystique/d-scope
- Repository: https://github.com/hughessystique/d-scope

## Overview

##### Main Components Identification
- Kubernetes Cluster – The deployment environment that will run all components.
- Istio – Noted as a prerequisite, Istio is used to manage ingress traffic and service meshes.
- Ingress Gateway – Acts as the external entry point into the system (the URL endpoints for site, ns, device, tunnel, etc.).
- Microservices (Pods/Deployments) – Represented by several discrete components:
- Frontend Service (frontend.yaml)
- NS Manager (nsmgr.yaml)
- Openness Manager (opennessmgr.yaml)
- OpenStack Manager (openstackmgr.yaml)
- SDNC Manager (sdncmgr.yaml)
- Site Manager (sitemgr.yaml)
- Docker Images – Pulled from Docker Hub (or from a local registry if needed), each corresponding to the above services.

##### Relationships and Interactions
- The Ingress (managed by Istio) receives incoming HTTP requests and routes the traffic to the appropriate microservice based on paths.
- The Frontend serves as the UI/API layer interfacing with other components.
- Each microservice (nsmgr, opennessmgr, openstackmgr, sdncmgr, and sitemgr) is deployed as a separate Kubernetes deployment with its own service. They likely interact in an orchestrated fashion to manage network services end-to-end.
- External interactions: Pulling Docker images from Docker Hub and interacting with the underlying infrastructure (via Istio and external docker registry, if necessary).

##### Architectural Patterns or Design Principles
- Microservices: Each service component (frontend, managers) is packaged and deployed independently using Helm.
- Infrastructure as Code: Using Helm charts to declaratively manage Kubernetes resources.
- Service Mesh: Leveraging Istio for making ingress and service-to-service communication more robust.
- Separation of Concerns: Each responsibility (exposing REST endpoints, managing different network components) is isolated into the relevant service.

##### Relevant Technologies, Frameworks, and Libraries
- Kubernetes – As the orchestration platform.
- Helm – Package manager and deployment mechanism.
- Istio – For ingress management and service mesh capabilities.
- Docker – Container images for each component.
- YAML – As configuration for deployments, services, and ingress rules.

##### Elements
- Use clear labels for each component (e.g., “Frontend”, “NS Manager”, etc.).
– Another for microservices (each manager and frontend).
– An additional style for external dependencies (Docker Hub, local registry).
- Configuration artifacts like Helm chart definitions and values as a side note that they drive deployments.

- Frontend Service (exposed via helm-charts/templates/deployments/frontend.yaml).
- Optionally, you might indicate that REST endpoints (like "/site", "/ns", etc.) are invoked, highlighting test endpoints and expected responses.
- Docker images associated with each microservice (e.g., hspl/d-scope-nsmgr) as part of the deployment process.
- A note about Helm and how the templates (deployments, services, ingresses) are used to create the final runtime configuration.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External entity
    EX["External Clients (Internet)"]:::external

    %% Kubernetes Cluster
    subgraph "Kubernetes Cluster"
        direction TB
        HELM["Helm Charts (Deployment Artifacts)"]:::infrastructure
        INGRESS["Istio Ingress Gateway"]:::infrastructure

        %% Microservices Subgraph
        subgraph "Microservices"
            direction TB
            %% Frontend Service Group
            subgraph "Frontend Service"
                direction TB
                FE_DEP["Frontend Deployment"]:::microservice
                FE_SER["Frontend Service"]:::microservice
                FE_DEP --> FE_SER
            end

            %% NS Manager Group
            subgraph "NS Manager"
                direction TB
                NS_DEP["NS Manager Deployment"]:::microservice
                NS_SER["NS Manager Service"]:::microservice
                NS_DEP --> NS_SER
            end

            %% Openness Manager Group
            subgraph "Openness Manager"
                direction TB
                OM_DEP["Openness Manager Deployment"]:::microservice
                OM_SER["Openness Manager Service"]:::microservice
                OM_DEP --> OM_SER
            end

            %% OpenStack Manager Group
            subgraph "OpenStack Manager"
                direction TB
                OSM_DEP["OpenStack Manager Deployment"]:::microservice
                OSM_SER["OpenStack Manager Service"]:::microservice
                OSM_DEP --> OSM_SER
            end

            %% SDNC Manager Group
            subgraph "SDNC Manager"
                direction TB
                SDNC_DEP["SDNC Manager Deployment"]:::microservice
                SDNC_SER["SDNC Manager Service"]:::microservice
                SDNC_DEP --> SDNC_SER
            end

            %% Site Manager Group
            subgraph "Site Manager"
                direction TB
                SM_DEP["Site Manager Deployment"]:::microservice
                SM_SER["Site Manager Service"]:::microservice
                SM_DEP --> SM_SER
            end
        end
    end

    %% Connections for traffic flow
    EX -->|"HTTPRequest"| INGRESS
    INGRESS -->|"Routes_to_UI/API"| FE_SER
    FE_SER -->|"calls_/ns"| NS_SER
    FE_SER -->|"calls_/openness"| OM_SER
    FE_SER -->|"calls_/openstack"| OSM_SER
    FE_SER -->|"calls_/sdnc"| SDNC_SER
    FE_SER -->|"calls_/site"| SM_SER

    %% Helm deployment arrows
    HELM -->|"Deploys"| INGRESS
    HELM -->|"Deploys"| FE_DEP
    HELM -->|"Deploys"| NS_DEP
    HELM -->|"Deploys"| OM_DEP
    HELM -->|"Deploys"| OSM_DEP
    HELM -->|"Deploys"| SDNC_DEP
    HELM -->|"Deploys"| SM_DEP

    %% Click Events
    click HELM "https://github.com/hughessystique/d-scope/tree/main/helm-charts"
    click INGRESS "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/ingresses/dvofgateway.yaml"

    click FE_DEP "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/deployments/frontend.yaml"
    click FE_SER "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/services/frontend.yaml"

    click NS_DEP "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/deployments/nsmgr.yaml"
    click NS_SER "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/services/nsmgr.yaml"

    click OM_DEP "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/deployments/opennessmgr.yaml"
    click OM_SER "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/services/opennessmgr.yaml"

    click OSM_DEP "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/deployments/openstackmgr.yaml"
    click OSM_SER "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/services/openstackmgr.yaml"

    click SDNC_DEP "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/deployments/sdncmgr.yaml"
    click SDNC_SER "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/services/sdncmgr.yaml"

    click SM_DEP "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/deployments/sitemgr.yaml"
    click SM_SER "https://github.com/hughessystique/d-scope/blob/main/helm-charts/templates/services/sitemgr.yaml"

    %% Styles
    classDef infrastructure fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef microservice fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef external fill:#F5F5DC,stroke:#000,stroke-width:2px;
```
