# argoproj/argo-rollouts architecture

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

- Interactive diagram: https://gitdiagram.com/argoproj/argo-rollouts
- Repository: https://github.com/argoproj/argo-rollouts

## Overview

##### Main Components Identification

a) Core Components:
- Rollouts Controller (main control plane)
- Custom Resource Definitions (CRDs)
- Kubernetes API Server integration
- Plugin System
- Dashboard/UI Component

b) Integration Components:
- Traffic Management Systems
- Metric Providers
- Analysis Engines

**┌─ Kubernetes Cluster ──────────────────────────────────────────────┐**

- ┌─ Control Plane ─────────────┐    ┌─ Custom Resources ───────┐ │

- Argo Rollouts Controller    │    │ - Rollout               │ │
- Analysis Controller       │◄─►│ - AnalysisRun           │ │
- Experiment Controller     │    │ - AnalysisTemplate      │ │
- Rollout Controller        │    │ - Experiment            │ │

- ┘    └──────────────────────────┘ │
- ▲                                              │

- ┌─ Traffic Management ───────┐    ┌─ Metric Providers ────────┐ │

- Istio                    │    │ - Prometheus             │ │
- NGINX Ingress           │    │ - Datadog                │ │
- AWS ALB                  │    │ - New Relic              │ │
- SMI                      │    │ - Wavefront              │ │
- Others via Plugins       │    │ - Custom via Plugins     │ │
- ┘    └───────────────────────────┘ │

- ┘

##### Key Elements to Highlight

a) Controller Architecture:
- Main controller loop
- Reconciliation process
- Analysis and experiment subsystems

b) Traffic Management:
- How traffic routing decisions are made
- Integration points with various ingress controllers
- Demonstrate canary and blue-green deployment patterns

c) Metric Analysis:
- Metric collection flow
- Analysis decision making
- Rollback/promotion paths

##### Implementation Details

- Relationship between `/controller`, `/rollout`, and `/analysis` packages
- How the `/metricproviders` integrate
- Connection to the `/ui` dashboard
- Plugin system from `/utils/plugin`

##### Deployment Flow

- Progressive delivery stages
- Analysis points
- Traffic shifting mechanisms
- Rollback paths

This system design should be created using a professional diagramming tool that supports:
- Nested containers
- Multiple connection types
- Export to high-resolution formats

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Kubernetes["Kubernetes Cluster"]
        subgraph Control["Control Plane"]
            RC["Rollouts Controller"]:::controller
            AC["Analysis Controller"]:::controller
            EC["Experiment Controller"]:::controller
            click RC "https://github.com/argoproj/argo-rollouts/blob/master/controller/controller.go"
            click AC "https://github.com/argoproj/argo-rollouts/blob/master/analysis/controller.go"
            click EC "https://github.com/argoproj/argo-rollouts/blob/master/experiments/controller.go"
        end

        subgraph Resources["Custom Resources"]
            R["Rollout CRD"]:::resource
            AR["AnalysisRun CRD"]:::resource
            AT["AnalysisTemplate CRD"]:::resource
            E["Experiment CRD"]:::resource
            click R "https://github.com/argoproj/argo-rollouts/blob/master/manifests/crds/rollout-crd.yaml"
            click AR "https://github.com/argoproj/argo-rollouts/blob/master/manifests/crds/analysis-run-crd.yaml"
            click E "https://github.com/argoproj/argo-rollouts/blob/master/manifests/crds/experiment-crd.yaml"
        end

        subgraph Traffic["Traffic Management"]
            direction TB
            TBase["Base Router"]:::traffic
            Istio["Istio"]:::traffic
            Nginx["NGINX"]:::traffic
            ALB["AWS ALB"]:::traffic
            SMI["SMI"]:::traffic
            click TBase "https://github.com/argoproj/argo-rollouts/tree/master/rollout/trafficrouting/"
            click Istio "https://github.com/argoproj/argo-rollouts/tree/master/rollout/trafficrouting/istio/"
            click Nginx "https://github.com/argoproj/argo-rollouts/tree/master/rollout/trafficrouting/nginx/"
            click ALB "https://github.com/argoproj/argo-rollouts/tree/master/rollout/trafficrouting/alb/"
            click SMI "https://github.com/argoproj/argo-rollouts/tree/master/rollout/trafficrouting/smi/"
        end

        subgraph Metrics["Metric Providers"]
            direction TB
            Prom["Prometheus"]:::metric
            DD["Datadog"]:::metric
            NR["New Relic"]:::metric
            WF["Wavefront"]:::metric
            click Prom "https://github.com/argoproj/argo-rollouts/tree/master/metricproviders/prometheus/"
            click DD "https://github.com/argoproj/argo-rollouts/tree/master/metricproviders/datadog/"
            click NR "https://github.com/argoproj/argo-rollouts/tree/master/metricproviders/newrelic/"
            click WF "https://github.com/argoproj/argo-rollouts/tree/master/metricproviders/wavefront/"
        end

        subgraph Analysis["Analysis Engine"]
            AE["Analysis Core"]:::analysis
            AM["Analysis Metrics"]:::analysis
            click AE "https://github.com/argoproj/argo-rollouts/blob/master/analysis/analysis.go"
        end

        subgraph Plugin["Plugin System"]
            PS["Plugin Core"]:::plugin
            PT["Plugin Types"]:::plugin
            click PS "https://github.com/argoproj/argo-rollouts/blob/master/utils/plugin/plugin.go"
            click PT "https://github.com/argoproj/argo-rollouts/tree/master/utils/plugin/types/"
        end

        subgraph UI["Dashboard"]
            DC["Dashboard Core"]:::ui
            UICOMP["UI Components"]:::ui
            click DC "https://github.com/argoproj/argo-rollouts/tree/master/ui/src/app/"
            click UICOMP "https://github.com/argoproj/argo-rollouts/tree/master/ui/src/app/components/"
        end
    end

    %% Connections
    Control --> Resources
    Control --> Traffic
    Control --> Metrics
    Analysis --> Metrics
    Plugin --> Traffic
    Plugin --> Metrics
    UI --> Control

    %% Styles
    classDef controller fill:#2196F3,stroke:#1565C0,color:white
    classDef resource fill:#4CAF50,stroke:#388E3C,color:white
    classDef traffic fill:#FF9800,stroke:#F57C00,color:white
    classDef metric fill:#9C27B0,stroke:#7B1FA2,color:white
    classDef analysis fill:#00BCD4,stroke:#0097A7,color:white
    classDef plugin fill:#673AB7,stroke:#512DA8,color:white
    classDef ui fill:#795548,stroke:#5D4037,color:white

    %% Legend
    subgraph Legend
        L1["Controller Components"]:::controller
        L2["Kubernetes Resources"]:::resource
        L3["Traffic Management"]:::traffic
        L4["Metric Providers"]:::metric
        L5["Analysis Components"]:::analysis
        L6["Plugin System"]:::plugin
        L7["UI Components"]:::ui
    end
```
