# chenlevin89/sandbox architecture

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

- Interactive diagram: https://gitdiagram.com/chenlevin89/sandbox
- Repository: https://github.com/chenlevin89/sandbox

## Overview

##### Project type and purpose
- This repository is a Helm‐based Kubernetes packaging project (“sandbox”) that provides multiple Helm charts and subcharts to deploy Telepresence into a cluster.
- There are three “charts” in play:
– A root-level chart (Chart.yaml, values.yaml, templates/)
– A telepresence subchart (folder telepresence/)
– A second variant subchart (folder telepresence_new/)
- Each of the telepresence folders is a full Helm chart (Chart.yaml + values.yaml + templates) packaging Telepresence components—agent, traffic‐manager, webhook injector, RBAC rules, certificates, etc.

##### File structure
- Top-level:
– .helmignore, Chart.yaml, values.yaml, templates/ → this is the parent chart scaffold
– apps/app-1.yml → an example or test manifest not managed by Helm
– telepresence-2.17.1.tgz → a packaged chart archive (dependency)
- Subcharts (telepresence/ and telepresence_new/):
– Chart.yaml + values.yaml → metadata + default configuration
– templates/ → Kubernetes resources (Deployments, Services, ConfigMaps, RBAC, Webhook, Issuer, etc.)
- The duplication between telepresence/ and telepresence_new/ suggests either A/B testing or two versions of the Telepresence chart.

##### README
- README.md simply says “# sandbox,” so we infer nothing extra. All architectural details come from the file tree and knowledge of Telepresence.

##### Capturing essential architectural elements
- Don’t just list files—group them by function (packages vs templates vs runtime).
- How the Helm chart hierarchy maps to real Kubernetes resources.
- Injection pattern (webhook → sidecar) that is core to Telepresence.
- Two subchart variants side by side to highlight versioning or A/B use.
- Values.yaml as the customization/control point for each chart.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Packaging Layer"
        classDef packaging fill:#BBDEFB,stroke:#0D47A1,color:#0D47A1

        HelmClient["Developer Helm CLI"]:::packaging

        subgraph "Root Helm Chart"
            direction TB
            ignore[".helmignore"]:::packaging
            rootChartY["Chart.yaml"]:::packaging
            rootValues["values.yaml"]:::packaging
            rootTemplates["templates/"]:::packaging
        end

        subgraph "telepresence Subchart"
            direction TB
            teleChartY["Chart.yaml"]:::packaging
            teleValues["values.yaml"]:::packaging
            teleTemplates["templates/"]:::packaging
        end

        subgraph "telepresence_new Subchart"
            direction TB
            newChartY["Chart.yaml"]:::packaging
            newValues["values.yaml"]:::packaging
            newTemplates["templates/"]:::packaging
        end

        PackageTgz["telepresence-2.17.1.tgz"]:::packaging
        AppManifest["apps/app-1.yml"]:::packaging
    end

    subgraph "Runtime Layer"
        classDef k8s fill:#C8E6C9,stroke:#1B5E20,color:#1B5E20
        classDef workload fill:#FFE0B2,stroke:#E65100,color:#E65100
        classDef config fill:#FFF9C4,stroke:#F57F17,color:#F57F17
        classDef external fill:#E1BEE7,stroke:#6A1B9A,color:#6A1B9A

        APIServer["Kubernetes API Server"]:::k8s

        subgraph "Telepresence Components"
            direction TB
            TMDep["Deployment: traffic-manager"]:::workload
            TMSvc["Service: traffic-manager"]:::workload
            Webhook["MutatingWebhookConfiguration"]:::k8s
            RBACCerts["RBAC & Certificates"]:::config
        end

        AppPod["Developer App Pod"]:::workload
        Agent["Telepresence Agent Sidecar"]:::workload
        DevCLI["Telepresence CLI"]:::external
    end

    %% Connections
    HelmClient -->|"installs"| rootChartY
    rootChartY -->|"references"| teleChartY
    rootChartY -->|"references"| newChartY
    rootChartY -->|"uses dependency"| PackageTgz
    rootChartY -->|"deploys"| APIServer

    teleChartY -->|"deploys resources to"| APIServer
    newChartY -->|"deploys resources to"| APIServer

    DevCLI -->|"connects to"| TMSvc
    APIServer -->|"schedules"| TMDep
    APIServer -->|"triggers webhook"| Webhook
    Webhook -->|"injects sidecar"| Agent
    Agent -->|"runs in"| AppPod
    TMSvc -->|"routes traffic to"| TMDep
    TMDep -->|"binds"| RBACCerts

    %% Click Events
    click ignore "https://github.com/chenlevin89/sandbox/blob/main/.helmignore"
    click rootChartY "https://github.com/chenlevin89/sandbox/blob/main/Chart.yaml"
    click rootValues "https://github.com/chenlevin89/sandbox/blob/main/values.yaml"
    click rootTemplates "https://github.com/chenlevin89/sandbox/tree/main/templates/"
    click teleChartY "https://github.com/chenlevin89/sandbox/blob/main/telepresence/Chart.yaml"
    click teleValues "https://github.com/chenlevin89/sandbox/blob/main/telepresence/values.yaml"
    click teleTemplates "https://github.com/chenlevin89/sandbox/tree/main/telepresence/templates/"
    click newChartY "https://github.com/chenlevin89/sandbox/blob/main/telepresence_new/Chart.yaml"
    click newValues "https://github.com/chenlevin89/sandbox/blob/main/telepresence_new/values.yaml"
    click newTemplates "https://github.com/chenlevin89/sandbox/tree/main/telepresence_new/templates/"
    click PackageTgz "https://github.com/chenlevin89/sandbox/blob/main/telepresence-2.17.1.tgz"
    click AppManifest "https://github.com/chenlevin89/sandbox/blob/main/apps/app-1.yml"
```
