# cdk8s-team/cdk8s architecture

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

- Interactive diagram: https://gitdiagram.com/cdk8s-team/cdk8s
- Repository: https://github.com/cdk8s-team/cdk8s

## Overview

##### Main Components

a) Core Framework Components:
- CDK8s Core (central component)
- CLI Tool
- CDK8s Plus (high-level constructs)
- Language Bindings (TypeScript, Python, Java, Go)

b) Build/Synthesis Pipeline:
- Source Code Input
- Construct Tree Processing
- Kubernetes Manifest Generation
- Output Directory (dist)

c) Integration Points:
- Kubernetes Cluster Interface
- Helm Chart Integration
- Custom Resource Definitions (CRD) Support
- AWS CDK Interoperability

**[Developer Code] --> [Language Bindings] --> [CDK8s CLI]**

**[CDK8s Core Library]**

**[Construct Tree]**

**[CDK8s Plus Abstractions]**

**[Manifest Synthesis] --> [Kubernetes YAML]**

##### Key Relationships to Highlight

- Construct hierarchy:
- App (root)
- Charts
- Constructs
- Resources

- Synthesis flow:
- Source Code -> Construct Tree -> K8s Manifests -> Kubernetes Cluster

##### Important Details

- Version support for different Kubernetes schemas (v1.14.0 - v1.31.0)
- Supported language bindings
- Helm chart integration capabilities
- Custom Resource Definition support
- Testing framework integration

##### Specific Implementation Notes

- How the CLI tools (`import`, `init`, `synth`) interact with the system
- Escape hatch mechanism for direct YAML manipulation
- Demonstrate the relationship between CDK8s Plus and core components
- How the construct library interfaces with Kubernetes resources

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "Developer Interface"
        Dev[Developer Code]
        LangBindings[Language Bindings]
        CLI[CLI Tools]:::cli
    end

    subgraph "Core Processing Layer"
        Core[CDK8s Core]:::core
        Constructs[Construct Tree]
        Plus[CDK8s Plus]:::plus
    end

    subgraph "Output Layer"
        Synthesis[Manifest Synthesis]
        K8sYAML[Kubernetes YAML]
    end

    subgraph "Integration Layer"
        Helm[Helm Charts]
        CRD[Custom Resources]
        K8s[Kubernetes Cluster]
    end

    subgraph "Language Support"
        TS[TypeScript]:::typescript
        PY[Python]:::python
        JAVA[Java]:::java
        GO[Go]:::go
    end

    Dev --> LangBindings
    LangBindings --> CLI
    CLI --> Core
    Core --> Constructs
    Constructs --> Plus
    Plus --> Synthesis
    Synthesis --> K8sYAML
    K8sYAML --> K8s

    Core -.-> Helm
    Core -.-> CRD

    LangBindings --- TS
    LangBindings --- PY
    LangBindings --- JAVA
    LangBindings --- GO

    %% Click Events
    click CLI "https://github.com/cdk8s-team/cdk8s/tree/master//docs/cli/"
    click TS "https://github.com/cdk8s-team/cdk8s/tree/master//examples/typescript"
    click PY "https://github.com/cdk8s-team/cdk8s/tree/master//examples/python"
    click JAVA "https://github.com/cdk8s-team/cdk8s/tree/master//examples/java"
    click GO "https://github.com/cdk8s-team/cdk8s/tree/master//examples/go"
    click Plus "https://github.com/cdk8s-team/cdk8s/tree/master//docs/plus/"
    click Core "https://github.com/cdk8s-team/cdk8s/tree/master//docs/reference/cdk8s/"
    click Helm "https://github.com/cdk8s-team/cdk8s/tree/master//examples/typescript/helm-bitnami"
    click CRD "https://github.com/cdk8s-team/cdk8s/tree/master//examples/typescript/crd"

    %% Styling
    classDef core fill:#2374ab
    classDef cli fill:#ff7f50
    classDef plus fill:#9b59b6
    classDef typescript fill:#007acc
    classDef python fill:#ffd43b
    classDef java fill:#b07219
    classDef go fill:#00add8

    %% Legend
    subgraph Legend
        L1[Core Components]:::core
        L2[CLI Tools]:::cli
        L3[CDK8s Plus]:::plus
        L4[TypeScript]:::typescript
        L5[Python]:::python
        L6[Java]:::java
        L7[Go]:::go
    end
```
