# hazelcast/charts architecture

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

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

## Overview

##### Project Type and Purpose
- The project is an open-source repository for Helm charts.
- Its main purpose is to enable users to deploy Hazelcast clusters on Kubernetes via Helm.
- The README points to installation documentation and guides for both Hazelcast and Hazelcast Enterprise.

##### File Structure Analysis
- Top-level directories and files:
- .github: Contains CI/CD workflows (e.g., chart update, pull request builder, push charts) which handle automated testing and deployment of the charts.
- stable: The primary location for the two Helm charts (hazelcast and hazelcast-enterprise), each following the common Helm chart structure:
▸ Chart.yaml (defines the chart metadata)
▸ values.yaml (default configurable values)
▸ templates/: Contains Kubernetes resource templates such as StatefulSets, Services, Ingress, Roles, RoleBindings, and tests directories.
- Other files include CONTRIBUTING.md, LICENSE, and artifacthub-repo.yml (indicating integration with Artifact Hub for distribution).

##### Key Components
a. CI/CD Pipeline:
- Represented by the .github directory and its workflow files.
- How changes are automatically checked (dependabot), built (pr-builder), and deployed (push-charts, chart-update).
b. Helm Charts:
- Two main components: “hazelcast” and “hazelcast-enterprise” located under the stable directory.
- Each chart contains its own metadata (Chart.yaml), configuration (values.yaml), and a rich set of templates for deploying different Kubernetes resources.
c. Testing and Validation:
- The templates/tests directories within each chart include test files (e.g., test-hazelcast.yaml, test-management-center.yaml) used for chart verification.
d. Distribution:
- The artifacthub-repo.yml and README links indicate integration with Artifact Hub. This serves as an external distribution and discovery mechanism.

##### Architectural Patterns and Design Principles
- Modularization: Separation of concerns by having distinct directories for each chart and for CI/CD workflows.
- Declarative Configuration: The use of Helm charts to declaratively define Kubernetes resources.
- CI/CD Integration: Automated pull request building, testing, and chart updating pipelines.
- Extensibility: Templates are modular with helper templates and separate test files to allow customization and extension.

## Diagram (Mermaid)

```mermaid
flowchart TD
    A["Code Repository"]:::code

    subgraph "CI/CD Pipeline"
        B[".github Directory"]:::pipeline
        B1["chart-update.yml"]:::workflow
        B2["pr-builder.yml"]:::workflow
        B3["push-charts.yml"]:::workflow
        B4["dependabot.yml"]:::workflow
        B --> B1
        B --> B2
        B --> B3
        B --> B4
    end

    subgraph "Helm Charts"
        subgraph "Hazelcast Chart"
            C["Hazelcast Chart Module"]:::chartModule
            C1["Chart.yaml"]:::file
            C2["values.yaml"]:::file
            C3["Templates"]:::template
            C4["Test Templates"]:::test
            C --> C1
            C --> C2
            C --> C3
            C3 --> C4
        end

        subgraph "Hazelcast Enterprise Chart"
            D["Hazelcast Enterprise Module"]:::chartModule
            D1["Chart.yaml"]:::file
            D2["values.yaml"]:::file
            D3["Templates"]:::template
            D4["Test Templates"]:::test
            D --> D1
            D --> D2
            D --> D3
            D3 --> D4
        end
    end

    E["Artifact Hub Distribution"]:::external

    A --> B
    B --> C
    B --> D
    C --> E
    D --> E

    click B "https://github.com/hazelcast/charts/blob/master/.github"
    click B1 "https://github.com/hazelcast/charts/blob/master/.github/workflows/chart-update.yml"
    click B2 "https://github.com/hazelcast/charts/blob/master/.github/workflows/pr-builder.yml"
    click B3 "https://github.com/hazelcast/charts/blob/master/.github/workflows/push-charts.yml"
    click B4 "https://github.com/hazelcast/charts/blob/master/.github/dependabot.yml"

    click C "https://github.com/hazelcast/charts/tree/master/stable/hazelcast"
    click C1 "https://github.com/hazelcast/charts/blob/master/stable/hazelcast/Chart.yaml"
    click C2 "https://github.com/hazelcast/charts/blob/master/stable/hazelcast/values.yaml"
    click C3 "https://github.com/hazelcast/charts/tree/master/stable/hazelcast/templates"
    click C4 "https://github.com/hazelcast/charts/tree/master/stable/hazelcast/templates/tests"

    click D "https://github.com/hazelcast/charts/tree/master/stable/hazelcast-enterprise"
    click D1 "https://github.com/hazelcast/charts/blob/master/stable/hazelcast-enterprise/Chart.yaml"
    click D2 "https://github.com/hazelcast/charts/blob/master/stable/hazelcast-enterprise/values.yaml"
    click D3 "https://github.com/hazelcast/charts/tree/master/stable/hazelcast-enterprise/templates"
    click D4 "https://github.com/hazelcast/charts/tree/master/stable/hazelcast-enterprise/templates/tests"

    click E "https://github.com/hazelcast/charts/blob/master/artifacthub-repo.yml"

    classDef code fill:#f9f,stroke:#333,stroke-width:2px;
    classDef pipeline fill:#bbf,stroke:#333,stroke-width:1px;
    classDef workflow fill:#cff,stroke:#333,stroke-width:1px;
    classDef chartModule fill:#fcf,stroke:#333,stroke-width:1px;
    classDef file fill:#efe,stroke:#333,stroke-width:1px;
    classDef template fill:#ffe,stroke:#333,stroke-width:1px;
    classDef test fill:#def,stroke:#333,stroke-width:1px;
    classDef external fill:#fdd,stroke:#333,stroke-width:2px;
```
