# dhanushbontha/predictive-kubernetes-autoscaling architecture

> Architecture diagram of the GitHub repository dhanushbontha/predictive-kubernetes-autoscaling, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dhanushbontha/predictive-kubernetes-autoscaling
- Repository: https://github.com/dhanushbontha/predictive-kubernetes-autoscaling

## Overview

This platform benchmarks predictive Prophet/KEDA autoscaling against reactive HPA by running synthetic traffic scenarios, collecting cluster and request telemetry, and persisting results for comparison. Users launch and monitor runs in the dashboard; the Spring backend orchestrates workloads and cluster controls, then calculates results from telemetry and exposes history and comparisons. The forecasting service learns from Prometheus history and publishes predicted request rates. The README documents cluster-level integrations and benchmark capabilities; unsampled subsystem links below rely on those statements rather than inspected implementation.

Main entry points: [`experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java`](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java) (Experiment Lifecycle), [`dashboard/src/App.jsx`](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/App.jsx) (Dashboard UI), [`workload-service/src/main/java/com/autoscaling/workload/controller/WorkloadController.java`](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/workload-service/src/main/java/com/autoscaling/workload/controller/WorkloadController.java) (Workload Endpoint), [`forecasting-service/app/service.py`](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/forecasting-service/app/service.py) (Forecast Orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_ui["Dashboard UI<br/>[App.jsx]"]
  node_research_matrix["Research Matrix<br/>[researchMatrix.js]"]
  node_dashboard_api["Dashboard API Client<br/>[api.js]"]
  node_comparison_view["Comparison View<br/>[ComparisonView.jsx]"]
  node_history_view["History View<br/>[HistoryView.jsx]"]
end

subgraph group_orchestration["Experiment Orchestration"]
  node_experiment_api["Experiment API"]
  node_dashboard_api_backend["Dashboard API"]
  node_lifecycle["Experiment Lifecycle"]
  node_benchmark_runner["Benchmark Runner"]
  node_k8s_orchestrator["Kubernetes Orchestrator"]
end

subgraph group_forecasting["Forecasting"]
  node_forecast_service["Forecast Orchestrator<br/>[service.py]"]
  node_forecast_scraper["Prometheus Scraper<br/>[scraper.py]"]
  node_prophet_model["Prophet Forecaster<br/>[model.py]"]
end

subgraph group_cluster["Workload and Scaling"]
  node_k6_jobs["k6 Traffic Profiles<br/>[bursty.js]"]
  node_workload_api["Workload Endpoint"]
  node_workload_compute["CPU Workload"]
  node_keda{{"Predictive KEDA"}}
  node_hpa{{"Reactive HPA"}}
end

subgraph group_data["Telemetry and Results"]
  node_experiment_model["Experiment Domain<br/>[Experiment.java]"]
  node_experiment_store[("Experiment Storage")]
  node_postgres[("PostgreSQL")]
  node_telemetry_client["Prometheus Client"]
  node_prometheus[("Prometheus")]
end

node_engineer(("Platform User"))

node_engineer -->|"operates"| node_dashboard_ui
node_dashboard_ui -->|"uses protocol"| node_research_matrix
node_dashboard_ui -->|"requests runs"| node_dashboard_api
node_dashboard_ui -->|"renders"| node_comparison_view
node_dashboard_ui -->|"renders"| node_history_view
node_dashboard_api -->|"calls REST"| node_experiment_api
node_dashboard_api -->|"calls REST"| node_dashboard_api_backend
node_experiment_api -->|"dispatches"| node_lifecycle
node_experiment_api -->|"starts matrix"| node_benchmark_runner
node_dashboard_api_backend -->|"requests data"| node_lifecycle
node_lifecycle -->|"controls cluster"| node_k8s_orchestrator
node_lifecycle -->|"queries metrics"| node_telemetry_client
node_lifecycle -->|"persists runs"| node_experiment_store
node_experiment_store -->|"stores"| node_postgres
node_lifecycle -->|"builds results"| node_experiment_model
node_telemetry_client -->|"queries PromQL"| node_prometheus
node_k8s_orchestrator -->|"dispatches jobs"| node_k6_jobs
node_k6_jobs -->|"sends traffic"| node_workload_api
node_workload_api -->|"invokes"| node_workload_compute
node_workload_api -->|"exports metrics"| node_prometheus
node_forecast_service -->|"fetches history"| node_forecast_scraper
node_forecast_service -->|"fits forecasts"| node_prophet_model
node_forecast_service -->|"publishes gauge"| node_prometheus
node_prometheus -->|"provides history"| node_forecast_scraper
node_prometheus -->|"provides predicted RPS"| node_keda
node_prometheus -->|"provides CPU metrics"| node_hpa
node_keda -->|"scales proactively"| node_workload_api
node_hpa -->|"scales reactively"| node_workload_api

click node_dashboard_ui "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/App.jsx"
click node_research_matrix "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/services/researchMatrix.js"
click node_dashboard_api "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/services/api.js"
click node_comparison_view "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/components/ComparisonView.jsx"
click node_history_view "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/components/HistoryView.jsx"
click node_experiment_api "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/controller/ExperimentController.java"
click node_dashboard_api_backend "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/controller/DashboardController.java"
click node_lifecycle "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java"
click node_benchmark_runner "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/BenchmarkMatrixRunner.java"
click node_k8s_orchestrator "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/KubernetesOrchestratorService.java"
click node_experiment_model "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/model/Experiment.java"
click node_experiment_store "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/entity/ExperimentEntity.java"
click node_telemetry_client "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/PrometheusClientService.java"
click node_k6_jobs "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/k6/bursty.js"
click node_workload_api "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/workload-service/src/main/java/com/autoscaling/workload/controller/WorkloadController.java"
click node_workload_compute "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/workload-service/src/main/java/com/autoscaling/workload/service/WorkloadComputationService.java"
click node_forecast_service "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/forecasting-service/app/service.py"
click node_forecast_scraper "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/forecasting-service/app/scraper.py"
click node_prophet_model "https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/forecasting-service/app/model.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_dashboard_ui,node_research_matrix,node_dashboard_api,node_comparison_view,node_history_view,node_engineer toneBlue
class node_experiment_api,node_dashboard_api_backend,node_lifecycle,node_benchmark_runner,node_k8s_orchestrator toneAmber
class node_forecast_service,node_forecast_scraper,node_prophet_model toneMint
class node_k6_jobs,node_workload_api,node_workload_compute,node_keda,node_hpa toneRose
class node_experiment_model,node_experiment_store,node_postgres,node_telemetry_client,node_prometheus toneIndigo
```

## Components

### Dashboard

- [Dashboard UI](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/App.jsx): `dashboard/src/App.jsx`
- [Research Matrix](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/services/researchMatrix.js): `dashboard/src/services/researchMatrix.js`
- [Dashboard API Client](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/services/api.js): `dashboard/src/services/api.js`
- [Comparison View](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/components/ComparisonView.jsx): `dashboard/src/components/ComparisonView.jsx`
- [History View](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/dashboard/src/components/HistoryView.jsx): `dashboard/src/components/HistoryView.jsx`

### Experiment Orchestration

- [Experiment API](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/controller/ExperimentController.java): `experiment-backend/src/main/java/com/autoscaling/backend/controller/ExperimentController.java`
- [Dashboard API](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/controller/DashboardController.java): `experiment-backend/src/main/java/com/autoscaling/backend/controller/DashboardController.java`
- [Experiment Lifecycle](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java): `experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java`
- [Benchmark Runner](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/BenchmarkMatrixRunner.java): `experiment-backend/src/main/java/com/autoscaling/backend/service/BenchmarkMatrixRunner.java`
- [Kubernetes Orchestrator](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/KubernetesOrchestratorService.java): `experiment-backend/src/main/java/com/autoscaling/backend/service/KubernetesOrchestratorService.java`

### Forecasting

- [Forecast Orchestrator](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/forecasting-service/app/service.py): `forecasting-service/app/service.py`
- [Prometheus Scraper](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/forecasting-service/app/scraper.py): `forecasting-service/app/scraper.py`
- [Prophet Forecaster](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/forecasting-service/app/model.py): `forecasting-service/app/model.py`

### Workload and Scaling

- [k6 Traffic Profiles](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/k6/bursty.js): `k6/bursty.js`
- [Workload Endpoint](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/workload-service/src/main/java/com/autoscaling/workload/controller/WorkloadController.java): `workload-service/src/main/java/com/autoscaling/workload/controller/WorkloadController.java`
- [CPU Workload](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/workload-service/src/main/java/com/autoscaling/workload/service/WorkloadComputationService.java): `workload-service/src/main/java/com/autoscaling/workload/service/WorkloadComputationService.java`
- **Predictive KEDA**
- **Reactive HPA**

### Telemetry and Results

- [Experiment Domain](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/model/Experiment.java): `experiment-backend/src/main/java/com/autoscaling/backend/model/Experiment.java`
- [Experiment Storage](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/entity/ExperimentEntity.java): `experiment-backend/src/main/java/com/autoscaling/backend/entity/ExperimentEntity.java`
- **PostgreSQL**
- [Prometheus Client](https://github.com/dhanushbontha/predictive-kubernetes-autoscaling/blob/main/experiment-backend/src/main/java/com/autoscaling/backend/service/PrometheusClientService.java): `experiment-backend/src/main/java/com/autoscaling/backend/service/PrometheusClientService.java`
- **Prometheus**

### Other components

- **Platform User**

## Connections

- Platform User → Dashboard UI: operates (evidence: `README.md`)
- Dashboard UI → Research Matrix: uses protocol (evidence: `dashboard/src/App.jsx`)
- Dashboard UI → Dashboard API Client: requests runs (evidence: `dashboard/src/App.jsx`)
- Dashboard UI → Comparison View: renders (evidence: `dashboard/src/App.jsx`)
- Dashboard UI → History View: renders (evidence: `dashboard/src/App.jsx`)
- Dashboard API Client → Experiment API: calls REST (evidence: `README.md`)
- Dashboard API Client → Dashboard API: calls REST (evidence: `README.md`)
- Experiment API → Experiment Lifecycle: dispatches (evidence: `experiment-backend/src/main/java/com/autoscaling/backend/controller/ExperimentController.java`)
- Experiment API → Benchmark Runner: starts matrix (evidence: `experiment-backend/src/main/java/com/autoscaling/backend/controller/ExperimentController.java`)
- Dashboard API → Experiment Lifecycle: requests data (evidence: `experiment-backend/src/main/java/com/autoscaling/backend/controller/DashboardController.java`)
- Experiment Lifecycle → Kubernetes Orchestrator: controls cluster (evidence: `experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java`)
- Experiment Lifecycle → Prometheus Client: queries metrics (evidence: `experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java`)
- Experiment Lifecycle → Experiment Storage: persists runs (evidence: `experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java`)
- Experiment Storage → PostgreSQL: stores (evidence: `README.md`)
- Experiment Lifecycle → Experiment Domain: builds results (evidence: `experiment-backend/src/main/java/com/autoscaling/backend/service/ExperimentLifecycleService.java`)
- Prometheus Client → Prometheus: queries PromQL (evidence: `README.md`)
- Kubernetes Orchestrator → k6 Traffic Profiles: dispatches jobs (evidence: `README.md`)
- k6 Traffic Profiles → Workload Endpoint: sends traffic (evidence: `README.md`)
- Workload Endpoint → CPU Workload: invokes (evidence: `workload-service/src/main/java/com/autoscaling/workload/controller/WorkloadController.java`)
- Workload Endpoint → Prometheus: exports metrics (evidence: `README.md`)
- Forecast Orchestrator → Prometheus Scraper: fetches history (evidence: `forecasting-service/app/service.py`)
- Forecast Orchestrator → Prophet Forecaster: fits forecasts (evidence: `forecasting-service/app/service.py`)
- Forecast Orchestrator → Prometheus: publishes gauge (evidence: `README.md`)
- Prometheus → Prometheus Scraper: provides history (evidence: `README.md`)
- Prometheus → Predictive KEDA: provides predicted RPS (evidence: `README.md`)
- Prometheus → Reactive HPA: provides CPU metrics (evidence: `README.md`)
- Predictive KEDA → Workload Endpoint: scales proactively (evidence: `README.md`)
- Reactive HPA → Workload Endpoint: scales reactively (evidence: `README.md`)
