# bokgil87/netdata architecture

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

- Interactive diagram: https://gitdiagram.com/bokgil87/netdata
- Repository: https://github.com/bokgil87/netdata

## Overview

##### Main Components

a. Core Infrastructure Components:
- Kubernetes Cluster
- Ingress Controller
- Persistent Storage System

b. Netdata Components:
- Parent Pod (Deployment)
- Child Pods (DaemonSet)
- Service Discovery Container
- Persistent Volumes
- ConfigMaps and Secrets

##### Component Relationships

- Data flow (metrics streaming from children to parent)
- Storage connections
- Network ingress
- Service discovery paths

##### Specific Implementation Details

- Parent-Child Architecture:
- Single parent deployment
- DaemonSet children on each node
- Streaming connections

- Storage Configuration:
- Parent: Two PVCs (database and alarms)
- Children: HostPath volume

- Service Discovery:
- Sidecar containers
- ConfigMap connections
- Discovered service endpoints

##### Additional Elements

Annotations for:
- Port numbers (19999 for parent)
- Volume sizes (2Gi for database, 1Gi for alarms)
- Key configuration paths
- RBAC connections

##### Technical Details

- Kubernetes API version requirements
- Resource requirements
- Configuration mount points
- Health check endpoints
- Service discovery supported applications

Key Considerations:
##### Integration points with external systems

Tools Recommendation:
Use a professional diagramming tool that supports:
- Custom styling
- Export in high resolution
- Collaborative editing

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Kubernetes Cluster
        subgraph Infrastructure Layer
            IC[Ingress Controller]:::infra
            PS[Persistent Storage]:::storage
        end

        subgraph Netdata Parent Layer
            PD[Parent Deployment]:::parent
            PDC[Parent Discovery Container]:::parent
            PVC1[Database PVC]:::storage
            PVC2[Alarms PVC]:::storage
            CM[ConfigMap]:::config
            SA[Service Account]:::rbac
            CR[Cluster Role]:::rbac
            CRB[Cluster Role Binding]:::rbac
            PSP[Pod Security Policy]:::security
            PSPCR[PSP Cluster Role]:::security
            PSPCRB[PSP Cluster Role Binding]:::security
        end

        subgraph Netdata Child Layer
            DS[Child DaemonSet]:::child
            CDC[Child Discovery Container]:::child
            HV[Host Path Volume]:::storage
            SDC[Service Discovery Config]:::config
        end

        subgraph Network Layer
            SVC[Service]:::network
            ING[Ingress]:::network
        end
    end

    %% Relationships
    IC --> ING
    ING --> SVC
    SVC --> PD
    PD --> PDC
    PD --> PVC1
    PD --> PVC2
    PD --> CM
    DS --> CDC
    DS --> HV
    DS --> SDC
    DS --> PD
    SA --> CR
    CR --> CRB
    PSP --> PSPCR
    PSPCR --> PSPCRB

    %% Click Events
    click PD "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/deployment.yaml"
    click DS "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/daemonset.yaml"
    click SDC "https://github.com/bokgil87/netdata/blob/master/charts/netdata/sdconfig/child.yml"
    click ING "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/ingress.yaml"
    click PVC1 "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/persistentvolumeclaim.yaml"
    click PVC2 "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/persistentvolumeclaim.yaml"
    click CM "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/configmap.yaml"
    click SVC "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/service.yaml"
    click CR "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/clusterrole.yaml"
    click CRB "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/clusterrolebinding.yaml"
    click SA "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/serviceaccount.yaml"
    click PSP "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/psp.yaml"
    click PSPCR "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/psp-clusterrole.yaml"
    click PSPCRB "https://github.com/bokgil87/netdata/blob/master/charts/netdata/templates/psp-clusterrolebinding.yaml"

    %% Styles
    classDef infra fill:#gray
    classDef parent fill:#blue
    classDef child fill:#green
    classDef storage fill:#yellow
    classDef network fill:#orange
    classDef config fill:#purple
    classDef rbac fill:#pink
    classDef security fill:#red

    %% Legend
    subgraph Legend
        L1[Infrastructure]:::infra
        L2[Parent Components]:::parent
        L3[Child Components]:::child
        L4[Storage]:::storage
        L5[Network]:::network
        L6[Configuration]:::config
        L7[RBAC]:::rbac
        L8[Security]:::security
    end
```
