# sipcapture/helm-charts architecture

> Architecture diagram of the GitHub repository sipcapture/helm-charts, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-10-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sipcapture/helm-charts
- Repository: https://github.com/sipcapture/helm-charts

## Overview

##### Project type and purpose
- This repository is a Helm chart packaging for “sipcapture”—a Kubernetes-native deployment of a SIP capture and analytics stack.
- It defines all the Kubernetes resources (StatefulSets, Services, ConfigMaps, Ingress, etc.) needed to deploy the Heplify SIP collector, time-series database, analytics agents, dashboards, and a web UI.

##### File structure
- Top-level:
- .github/workflows/helm.yml (CI/CD publishing the chart)
- LICENSE, README.md
- charts/sipcapture/
- charts/sipcapture/:
- Chart.yaml, values.yaml (chart metadata & default values)
- configs/: static dashboard JSON and datasource definitions for Grafana
- templates/: Kubernetes manifest templates for each component
– heplify-server (SIP capture)
– influxdb (time-series storage)
– postgres (relational metadata)
– telegraf (metrics collector)
– grafana (dashboards)
– webapp (user interface)
– namespace, ingress, helper functions, NOTES

##### README for additional insights
- The chart is published at a public Helm repo and contributed by the Jambonz project.

##### Main components and interactions to capture
a. External SIP traffic → Heplify Server (StatefulSet)
b. Heplify writes call records/metrics to:
- InfluxDB (StatefulSet + Service)
- Postgres (StatefulSet + Service)
c. Telegraf (StatefulSet + Service) scrapes metrics from InfluxDB and the Heplify server, then forwards them back into InfluxDB for enriched telemetry.
d. Grafana (StatefulSet + Service) reads from InfluxDB using configured datasources and displays dashboards (configured via ConfigMaps).
e. Webapp (Deployment + Service + Ingress) provides a user interface that reads aggregated data from Postgres and/or InfluxDB.

##### Architectural patterns and design principles
- Micro-services pattern: each functional component runs in its own StatefulSet/Deployment.
- Config-as-Code: dashboards and datasources are managed via Helm ConfigMaps.
- Stateful workloads: InfluxDB & Postgres use StatefulSets for persistent storage.
- Declarative infrastructure: everything is templated in Helm for repeatable deployments.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External traffic
    SIP["External SIP Traffic"]:::external
    ING["External Ingress"]:::external

    subgraph "Kubernetes Cluster"
        direction TB

        subgraph "SIP Capture" 
            style SIPC fill:#f9f,stroke:#333,stroke-width:1px
            HS["heplify-server\n(StatefulSet, Service, ConfigMap)"]:::sip
        end

        subgraph "Datastores"
            style DS fill:#9f9,stroke:#333,stroke-width:1px
            INF["InfluxDB\n(StatefulSet, Service)"]:::datastore
            PG["Postgres\n(StatefulSet, Service)"]:::datastore
        end

        subgraph "Analytics"
            style AN fill:#ff9,stroke:#333,stroke-width:1px
            TF["Telegraf\n(StatefulSet, Service, ConfigMap)"]:::analytics
            GF["Grafana\n(StatefulSet, Service, ConfigMaps & Dashboards)"]:::analytics
        end

        subgraph "User Interface"
            style UI fill:#9ff,stroke:#333,stroke-width:1px
            WA["Webapp\n(Deployment, Service, Ingress, ConfigMap)"]:::ui
        end
    end

    %% Data flows
    SIP -->|"SIP traffic"| HS
    HS -->|"write metrics"| INF
    HS -->|"write records"| PG

    INF -->|"scrape metrics"| TF
    HS -->|"scrape metrics"| TF
    TF -->|"forward metrics"| INF

    INF -->|"render dashboard"| GF

    INF -->|"read metrics"| WA
    PG -->|"read metadata"| WA

    ING -->|"HTTP requests"| WA

    %% Click Events for mappings
    click HS "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/heplify-server-statefulset.yaml"
    click HS "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/heplify-server-service.yaml"
    click HS "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/heplify-server-configmap.yaml"

    click INF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/influxdb-statefulset.yaml"
    click INF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/influxdb-service.yaml"

    click PG "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/postgres-statefulset.yaml"
    click PG "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/postgres-service.yaml"

    click TF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/telegraf-statefulset.yaml"
    click TF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/telegraf-service.yaml"
    click TF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/telegraf-configmap.yaml"

    click GF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/grafana-dashboard-configmap.yaml"
    click GF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/grafana-datasource-configmap.yaml"
    click GF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/configs/grafana/dashboards/jambonz-dashboard.json"
    click GF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/configs/grafana/dashboards/jambonz-heplify.json"
    click GF "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/configs/grafana/datasources.yaml"

    click WA "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/webapp-deployment.yaml"
    click WA "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/webapp-service.yaml"
    click WA "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/webapp-ingress.yaml"
    click WA "https://github.com/sipcapture/helm-charts/blob/main/charts/sipcapture/templates/webapp-configmap.yaml"

    %% Legend/Styles
    classDef sip fill:#f9f,stroke:#333,stroke-width:2px
    classDef datastore fill:#9f9,stroke:#333,stroke-width:2px
    classDef analytics fill:#ff9,stroke:#333,stroke-width:2px
    classDef ui fill:#9ff,stroke:#333,stroke-width:2px
    classDef external fill:#ccc,stroke:#333,stroke-width:1px,stroke-dasharray: 5 5
```
