# cloud-bulldozer/k8s-netperf architecture

> Architecture diagram of the GitHub repository cloud-bulldozer/k8s-netperf, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cloud-bulldozer/k8s-netperf
- Repository: https://github.com/cloud-bulldozer/k8s-netperf

## Overview

##### Main Components Identification

a. Core Components:
- Test Orchestrator (main application)
- Test Drivers (netperf, iperf3, uperf)
- Kubernetes Integration Layer
- Results Processor
- Metrics Collector

b. External Components:
- Kubernetes API Server
- Prometheus
- OpenSearch
- Test Pods/VMs (Client & Server)

- k8s-netperf System                                                |

- Config     |     |  Test Orchestrator|      |  Driver Manager  |      |   Results Manager  |       |
- Management   |---->|    (Main Logic)   |----->|  (netperf/iperf) |----->|   & Aggregator    |       |

- ^                      |                         |                           |                 |
- v                         v                           v                 |

- Test Config  |     |   K8s Interface   |      |   Test Executor  |      |   Metrics Collector|       |
- Parser      |     |     Layer         |      |                  |      |    & Reporter      |       |

- v                         v                           v

- Kubernetes      |    |   Test Pods/VMs  |    |  External Systems    |
- API Server      |    |  Client/Server   |    |  - Prometheus        |
- OpenSearch        |

##### Component Relationships
Following interactions:
- Config flow: Config file → Config Parser → Test Orchestrator
- Test execution flow: Orchestrator → Driver Manager → Test Executor → Pods/VMs
- Results flow: Test Executor → Results Manager → External Systems
- Kubernetes interaction: K8s Interface Layer ↔ Kubernetes API Server

##### Key Elements to Highlight
- Multiple test driver support (netperf, iperf3, uperf)
- Pod and VM deployment capabilities
- Metrics collection and reporting paths
- Configuration management flow
- Results processing and storage pipeline

##### Additional Details
Annotations for:
- Supported test types (TCP_STREAM, UDP_STREAM, etc.)
- Network topology options (same node, across nodes)
- Performance metrics collection points
- Data export formats (CSV, JSON)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph "Core Application"
        ConfigMgmt["Configuration Management"]:::config
        TestOrch["Test Orchestrator"]:::core
        DriverMgr["Driver Manager"]:::core
        ResultsMgr["Results Manager"]:::core
        ConfigParser["Test Config Parser"]:::config
        K8sInterface["Kubernetes Interface Layer"]:::k8s
        TestExec["Test Executor"]:::core
        MetricsCollector["Metrics Collector"]:::metrics
    end

    subgraph "Test Drivers"
        NetPerf["NetPerf Driver"]:::driver
        IPerf["iPerf Driver"]:::driver
        UPerf["uPerf Driver"]:::driver
    end

    subgraph "External Systems"
        K8sAPI["Kubernetes API Server"]:::external
        Prometheus["Prometheus"]:::external
        OpenSearch["OpenSearch"]:::external
        TestPods["Test Pods/VMs"]:::external
    end

    ConfigMgmt --> |"Config Flow"| ConfigParser
    ConfigParser --> |"Parsed Config"| TestOrch
    TestOrch --> |"Test Setup"| DriverMgr
    TestOrch --> |"K8s Operations"| K8sInterface
    DriverMgr --> |"Driver Selection"| NetPerf
    DriverMgr --> |"Driver Selection"| IPerf
    DriverMgr --> |"Driver Selection"| UPerf
    NetPerf & IPerf & UPerf --> TestExec
    TestExec --> |"Execute Tests"| TestPods
    TestExec --> |"Results"| ResultsMgr
    K8sInterface --> |"API Calls"| K8sAPI
    K8sAPI --> |"Pod/VM Management"| TestPods
    TestPods --> |"Performance Data"| MetricsCollector
    MetricsCollector --> |"Metrics"| ResultsMgr
    ResultsMgr --> |"Export Results"| Prometheus
    ResultsMgr --> |"Export Results"| OpenSearch

    %% Click Events
    click TestOrch "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/cmd/k8s-netperf/k8s-netperf.go"
    click NetPerf "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/pkg/drivers/netperf.go"
    click IPerf "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/pkg/drivers/iperf.go"
    click UPerf "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/pkg/drivers/uperf.go"
    click K8sInterface "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/pkg/k8s/kubernetes.go"
    click ResultsMgr "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/pkg/results/result.go"
    click MetricsCollector "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/pkg/metrics/system.go"
    click ConfigMgmt "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/pkg/config/config.go"
    click ConfigParser "https://github.com/cloud-bulldozer/k8s-netperf/blob/main/netperf.yml"

    %% Styles
    classDef core fill:#3498db,stroke:#2980b9,color:white
    classDef config fill:#2ecc71,stroke:#27ae60,color:white
    classDef k8s fill:#e74c3c,stroke:#c0392b,color:white
    classDef driver fill:#9b59b6,stroke:#8e44ad,color:white
    classDef metrics fill:#f1c40f,stroke:#f39c12,color:black
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white

    %% Legend
    subgraph Legend
        L1["Core Components"]:::core
        L2["Configuration"]:::config
        L3["Kubernetes Layer"]:::k8s
        L4["Test Drivers"]:::driver
        L5["Metrics"]:::metrics
        L6["External Systems"]:::external
    end
```
