# iits-consulting/charts architecture

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

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

## Overview

##### Project type and purpose
- This is a Helm‐charts repository (“IITS helm charts”) that packages multiple Kubernetes applications and utilities (e.g., cert‐manager, argocd, kafka, traefik, custom admin dashboard).
- Purpose: Provide versioned, well‐documented, testable charts that deploy into Kubernetes clusters behind an OIDC proxy and Traefik ingress.

##### File structure
- Top‐level:
- .github/workflows → CI pipelines for linting, testing and releasing charts
- charts/ → one subdirectory per public chart, each with Chart.yaml, values.yaml, templates/ and own README.md
- tests/ → kubernetes‐manifest tests for Kyverno policies
- create-trivy-ignore.sh, kubeconform-values.yaml → utility scripts/config for security scanning and schema validation
- Each chart subfolder follows Helm conventions: Chart.yaml (metadata), values.yaml (configurable parameters), templates/ (Kubernetes resource templates), NOTES.txt, optional subcharts.
- CI config uses GitHub Actions to: validate chart schemas, run helm-docs, run security scans (Trivy), run tests, then publish to Helm repo.

##### README for additional insights
- Acceptance criteria enforce Helm best practices: documented values, health checks, horizontal pod autoscaler, mutating webhook integration, subchart usage, NOTES.txt, licensing, .helmignore.
- External dependencies: OIDC proxy, Traefik Ingress Controller, Kyverno mutating/webhook policies.

a. Main components:
- Developer Workspace / GitHub Repo
- CI/CD Pipeline (GitHub Actions)
- Chart Repository (publish target, e.g., GitHub Pages or OCI registry)
- Kubernetes Cluster(s)
- Ingress Layer: Traefik
- Authentication: OIDC Proxy
- Kyverno Webhook Server
- Applications deployed by charts (AKHQ, Kafka, Elastic Stack, custom dashboards…)
- External Tools: Helm CLI, helm-docs, Trivy, kubeconform

b. Relationships and data flow:
1. Developer commits to GitHub → triggers GitHub Actions
2. CI Pipeline runs lint (helm lint), docs (helm-docs), security scan (Trivy), schema validation (kubeconform), unit tests (helm unittest, Kyverno tests)
3. On success, pipeline packages charts & publishes to Chart Repository
4. In target Kubernetes cluster, operators or users run `helm install/upgrade` pulling charts from the repository
5. Charts deploy Kubernetes CRDs, Deployments, Services, Ingress, ConfigMaps, HPA, Secrets (via mutating webhook injection)
6. Traefik handles ingress traffic, OIDC proxy enforces authentication, Kyverno mutates/injects secrets and enforces policies

c. Architectural patterns & principles:
- Modular packaging: one chart per component, use of subcharts for common dependencies
- GitOps/CICD: GitHub Actions automates validation and chart publication
- Policy‐as‐code: Kyverno policies as separate test files and templates
- Security by design: Trivy, mutating webhook for secrets, horizontal pod autoscalers, health checks

d. Key technologies/frameworks:
- Helm (charts, templates, values)
- Kubernetes (Deployments, StatefulSets, Ingress, RBAC)
- GitHub Actions (CI workflows: check_charts.yaml, release_charts.yaml, update_documentation.yaml)
- Traefik (Ingress Controller)
- OIDC Proxy (authentication)
- Kyverno (policy & mutating webhook)
- Tools: helm-docs, Trivy, kubeconform, helm unittest

## Diagram (Mermaid)

```mermaid
graph TB
  %% Developer & Repo
  subgraph "Developer & Repository"
    direction TB
    Dev["Developer Workspace / GitHub Repo"]:::code
  end

  %% CI/CD Pipeline
  subgraph "CI/CD Pipeline (GitHub Actions)" 
    direction TB
    Check["check_charts.yaml"]:::ci
    Release["release_charts.yaml"]:::ci
    UpdateDocs["update_documentation.yaml"]:::ci
    UT["tests/kyverno/ (Kyverno & unit tests)"]:::security
    TrivyUtil["create-trivy-ignore.sh"]:::ci
    KubeConfUtil["kubeconform-values.yaml"]:::ci
  end

  %% Chart Repository
  ChartRepo[(Chart Repository)]:::registry

  %% Helm Client
  HelmCLI["Helm CLI"]:::code

  %% Kubernetes Cluster
  subgraph "Kubernetes Cluster"
    direction TB
    subgraph "Ingress Layer"
      direction TB
      Traefik["Traefik Ingress Controller"]:::cluster
      OIDC["OIDC Proxy (forward-auth)"]:::cluster
    end
    Kyverno["Kyverno Policy & Mutating Webhook"]:::security
    subgraph "Applications Deployed"
      direction TB
      Argocd["Argo CD Core"]:::cluster
      ArgocdOIDC["Argo CD OIDC Subchart"]:::cluster
      Kafka["Kafka Platform"]:::cluster
      AKHQ["AKHQ (Kafka Admin UI)"]:::cluster
      Elastic["Elastic Stack Operator"]:::cluster
      AdminDash["Custom Admin Dashboard"]:::cluster
      Prometheus["Prometheus Monitoring Stack"]:::cluster
    end
  end

  %% Flows
  Dev -->|push commit| Check
  Check --> Release
  Release --> UpdateDocs
  UpdateDocs -->|runs tests| UT
  UpdateDocs -->|runs Trivy scan| TrivyUtil
  UpdateDocs -->|runs schema validation| KubeConfUtil
  UpdateDocs -->|on success| ChartRepo
  ChartRepo -->|helm pull| HelmCLI
  HelmCLI -->|"helm install/upgrade"| Traefik
  HelmCLI -->|"helm install/upgrade"| OIDC
  HelmCLI -->|"helm install/upgrade"| Kyverno
  HelmCLI -->|"helm install/upgrade"| Argocd
  HelmCLI -->|"helm install/upgrade"| ArgocdOIDC
  HelmCLI -->|"helm install/upgrade"| Kafka
  HelmCLI -->|"helm install/upgrade"| AKHQ
  HelmCLI -->|"helm install/upgrade"| Elastic
  HelmCLI -->|"helm install/upgrade"| AdminDash
  HelmCLI -->|"helm install/upgrade"| Prometheus

  %% Click Events
  click Dev "https://github.com/iits-consulting/charts/tree/main//"
  click Check "https://github.com/iits-consulting/charts/blob/main/.github/workflows/check_charts.yaml"
  click Release "https://github.com/iits-consulting/charts/blob/main/.github/workflows/release_charts.yaml"
  click UpdateDocs "https://github.com/iits-consulting/charts/blob/main/.github/workflows/update_documentation.yaml"
  click TrivyUtil "https://github.com/iits-consulting/charts/blob/main/create-trivy-ignore.sh"
  click KubeConfUtil "https://github.com/iits-consulting/charts/blob/main/kubeconform-values.yaml"
  click UT "https://github.com/iits-consulting/charts/tree/main/tests/kyverno/"
  click Traefik "https://github.com/iits-consulting/charts/tree/main/charts/traefik/"
  click OIDC "https://github.com/iits-consulting/charts/tree/main/charts/oidc-forward-auth/"
  click Kyverno "https://github.com/iits-consulting/charts/tree/main/charts/kyverno/"
  click Argocd "https://github.com/iits-consulting/charts/tree/main/charts/argocd/"
  click ArgocdOIDC "https://github.com/iits-consulting/charts/tree/main/charts/argocd-oidc/"
  click Kafka "https://github.com/iits-consulting/charts/tree/main/charts/kafka/"
  click AKHQ "https://github.com/iits-consulting/charts/tree/main/charts/akhq/"
  click Elastic "https://github.com/iits-consulting/charts/tree/main/charts/elastic-operator/"
  click AdminDash "https://github.com/iits-consulting/charts/tree/main/charts/iits-admin-dashboard/"
  click Prometheus "https://github.com/iits-consulting/charts/tree/main/charts/prometheus-stack/"

  %% Styles
  classDef code fill:#bbdefb,stroke:#1e88e5,color:#0d47a1
  classDef ci fill:#c8e6c9,stroke:#43a047,color:#1b5e20
  classDef registry fill:#ffe0b2,stroke:#f57c00,color:#e65100,shape:cylinder
  classDef cluster fill:#ffecb3,stroke:#fbc02d,color:#ff6f00
  classDef security fill:#ffcdd2,stroke:#e53935,color:#b71c1c
```
