# promptlylabs/wazuh-helm-chart architecture

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

- Interactive diagram: https://gitdiagram.com/promptlylabs/wazuh-helm-chart
- Repository: https://github.com/promptlylabs/wazuh-helm-chart

## Overview

##### Main Components Identification
- Wazuh Manager (Master/Worker nodes)
- Wazuh Indexer (Elasticsearch-based)
- Wazuh Dashboard (Kibana-based)
- Certificate Management System

##### Detailed Component Representation

For each component, show:

a) Wazuh Manager:
- Master node (StatefulSet)
- Worker nodes (StatefulSet)
- Cluster communication service
- API services
- Network policies

b) Indexer:
- StatefulSet of indexer nodes
- Rest API service
- Node-to-node communication service
- Network policies

c) Dashboard:
- Dashboard deployment
- Service
- Ingress
- Network policies

##### Security Layer
- Certificate management (cert-manager integration)
- Secrets management
- Network policies between components

##### Connection and Data Flow

- Agent connections to worker nodes
- Worker to master communication
- Manager to indexer data flow
- Dashboard to indexer queries
- User access through ingress

##### Additional Details

Annotations for:
- Pod disruption budgets
- ConfigMaps
- Volume mounts
- Resource requirements
- High availability setup

##### External Access: Clear indication of ingress points and API access

- Proper layering
- Clean connector routing
- Export to high-resolution formats
- Easy updates and modifications

- How components communicate
- Where data is stored
- How the system scales
- Security boundaries
- High availability features

This will create a comprehensive yet understandable representation of the Wazuh Helm chart architecture that can be used for both documentation and operational understanding.

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef statefulset fill:#3498db,stroke:#2980b9,color:white
    classDef deployment fill:#2ecc71,stroke:#27ae60,color:white
    classDef service fill:#f1c40f,stroke:#f39c12,color:black
    classDef ingress fill:#e74c3c,stroke:#c0392b,color:white
    classDef secret fill:#9b59b6,stroke:#8e44ad,color:white
    classDef configmap fill:#e67e22,stroke:#d35400,color:white
    classDef netpolicy fill:#1abc9c,stroke:#16a085,color:white
    classDef cert fill:#34495e,stroke:#2c3e50,color:white

    %% Infrastructure Layer
    subgraph Kubernetes
        %% Certificate Management
        CertManager["Certificate Manager"]:::cert
        click CertManager "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/certs/certificate.yaml"

        %% Manager Components
        subgraph Manager
            MasterNode["Manager Master Node"]:::statefulset
            WorkerNode["Manager Worker Node"]:::statefulset
            MgrClusterSvc["Cluster Communication Service"]:::service
            MgrConfig["Manager ConfigMap"]:::configmap
            MgrClusterSecret["Cluster Key Secret"]:::secret
            MgrApiSecret["API Credentials Secret"]:::secret
            MgrMasterNetPol["Master Network Policy"]:::netpolicy
            MgrWorkerNetPol["Worker Network Policy"]:::netpolicy

            click MasterNode "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/master/statefulset.yaml"
            click WorkerNode "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/worker/statefulset.yaml"
            click MgrClusterSvc "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/service-cluster.yaml"
            click MgrConfig "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/configmap.yaml"
            click MgrClusterSecret "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/secret-cluster-key.yaml"
            click MgrApiSecret "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/secret-api-cred.yaml"
            click MgrMasterNetPol "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/master/networkpolicy.yaml"
            click MgrWorkerNetPol "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/manager/worker/networkpolicy.yaml"
        end

        %% Indexer Components
        subgraph Indexer
            IndexerNodes["Indexer Cluster"]:::statefulset
            IndexerSvc["Node Communication Service"]:::service
            IndexerConfig["Indexer ConfigMap"]:::configmap
            IndexerNetPol["Indexer Network Policy"]:::netpolicy

            click IndexerNodes "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/indexer/statefulset.yaml"
            click IndexerSvc "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/indexer/service-nodes.yaml"
            click IndexerConfig "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/indexer/configmap.yaml"
            click IndexerNetPol "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/indexer/networkpolicy.yaml"
        end

        %% Dashboard Components
        subgraph Dashboard
            DashboardDep["Dashboard Deployment"]:::deployment
            DashboardConfig["Dashboard ConfigMap"]:::configmap
            DashboardIngress["Dashboard Ingress"]:::ingress
            DashboardNetPol["Dashboard Network Policy"]:::netpolicy

            click DashboardDep "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/dashboard/deployment.yaml"
            click DashboardConfig "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/dashboard/configmap.yaml"
            click DashboardIngress "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/dashboard/ingress.yaml"
            click DashboardNetPol "https://github.com/promptlylabs/wazuh-helm-chart/blob/main/charts/wazuh/templates/dashboard/networkpolicy.yaml"
        end
    end

    %% Relationships
    CertManager --> MasterNode
    CertManager --> WorkerNode
    CertManager --> IndexerNodes
    CertManager --> DashboardDep

    MgrConfig --> MasterNode
    MgrConfig --> WorkerNode
    MgrClusterSecret --> MasterNode
    MgrClusterSecret --> WorkerNode
    MgrApiSecret --> MasterNode
    MgrApiSecret --> WorkerNode

    WorkerNode --> MasterNode
    MasterNode --> IndexerNodes
    IndexerConfig --> IndexerNodes

    DashboardConfig --> DashboardDep
    DashboardDep --> IndexerNodes
    DashboardIngress --> DashboardDep

    %% Legend
    subgraph Legend
        L1["StatefulSet"]:::statefulset
        L2["Deployment"]:::deployment
        L3["Service"]:::service
        L4["Ingress"]:::ingress
        L5["Secret"]:::secret
        L6["ConfigMap"]:::configmap
        L7["Network Policy"]:::netpolicy
        L8["Certificate"]:::cert
    end
```
