# jenkins-infra/kubernetes-management architecture

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

- Interactive diagram: https://gitdiagram.com/jenkins-infra/kubernetes-management
- Repository: https://github.com/jenkins-infra/kubernetes-management

## Overview

##### Main Components

a) Cluster Layer:
- Different Kubernetes clusters (cijioagents1, cijioagents2, infracijioagents1, privatek8s, publick8s)

b) Configuration Management Layer:
- Helmfile deployments (from /clusters directory)
- Helm charts configuration (from /config directory)
- Secrets management with SOPS integration
- UpdateCLI automation system

c) External Services Layer:
- Azure Key Vault (for secrets)
- GitHub (for source code and secrets repository)
- Docker Registry (for container images)
- Cloud Providers (Azure, AWS, DigitalOcean - indicated by az, awscli, doctl requirements)

##### Component Relationships

- Helmfile → Kubernetes Clusters (deployment flow)
- UpdateCLI → GitHub (version updates)
- SOPS ↔ Azure Key Vault (secrets encryption/decryption)
- Clusters ↔ External Services (service dependencies)

##### Specific Implementation Details

Specialized components for:
- Jenkins Controllers (multiple instances per cluster)
- Ingress Controllers (both public and private nginx)
- Service-specific configurations (like accountapp, keycloak, LDAP, etc.)
- Monitoring solutions (Datadog, indicated by datadog.yaml files)

##### Infrastructure Layer (Bottom)
- Kubernetes clusters
- Cloud providers
- Storage systems

##### Configuration Layer (Middle)
- Helm charts
- Configuration files
- Secrets management

##### Automation Layer (Top)
- UpdateCLI
- CI/CD pipelines
- Monitoring and logging

##### Important Notes

- Version control flow showing how updates propagate
- Security boundaries and access controls
- High-availability setups where applicable
- Public vs. private network boundaries

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and Classes
    classDef cluster fill:#b3d9ff,stroke:#333,stroke-width:2px
    classDef service fill:#90EE90,stroke:#333,stroke-width:2px
    classDef config fill:#FFE5B4,stroke:#333,stroke-width:2px
    classDef security fill:#FFB6C1,stroke:#333,stroke-width:2px
    classDef monitoring fill:#DDA0DD,stroke:#333,stroke-width:2px
    classDef controller fill:#98FB98,stroke:#333,stroke-width:2px
    classDef ingress fill:#F0E68C,stroke:#333,stroke-width:2px
    classDef automation fill:#87CEEB,stroke:#333,stroke-width:2px

    subgraph Infrastructure
        subgraph K8sClusters["Kubernetes Clusters"]
            CIA1[CI Agents Cluster 1]:::cluster
            CIA2[CI Agents Cluster 2]:::cluster
            ICIA[Infra CI Agents]:::cluster
            PVK8S[Private K8s]:::cluster
            PBK8S[Public K8s]:::cluster
        end

        subgraph ExternalServices["External Services"]
            AKV[(Azure Key Vault)]:::service
            GH[GitHub]:::service
            DR[(Docker Registry)]:::service
            CP[Cloud Providers]:::service
        end
    end

    subgraph ConfigManagement["Configuration Management"]
        subgraph Controllers["Jenkins Controllers"]
            IC[Infra CI]:::controller
            RC[Release CI]:::controller
            WC[Weekly CI]:::controller
        end

        subgraph IngressControllers["Ingress Controllers"]
            PI[Private Ingress]:::ingress
            PBI[Public Ingress]:::ingress
        end

        subgraph CoreServices["Core Services"]
            KC[KeyCloak]:::service
            LDAP[LDAP]:::service
            CM[Cert Manager]:::security
            AA[Account App]:::service
        end

        subgraph Security["Security Components"]
            FALCO[Falco]:::security
            ACME[ACME]:::security
        end

        subgraph Monitoring["Monitoring"]
            DD[Datadog]:::monitoring
            DDC1[Datadog CI Agents 1]:::monitoring
            DDC2[Datadog CI Agents 2]:::monitoring
            DDPV[Datadog Private K8s]:::monitoring
            DDPB[Datadog Public K8s]:::monitoring
        end
    end

    subgraph Automation["Update Automation"]
        CU[Charts Updates]:::automation
        DI[Docker Images]:::automation
        JC[Jenkins Controllers Updates]:::automation
    end

    %% Relationships
    Controllers --> K8sClusters
    IngressControllers --> K8sClusters
    CoreServices --> K8sClusters
    Security --> K8sClusters
    Monitoring --> K8sClusters
    Automation --> GH
    K8sClusters --> ExternalServices
    Security --> AKV

    %% Click Events
    click CIA1 "https://github.com/jenkins-infra/kubernetes-management/blob/main/clusters/cijioagents1.yaml"
    click CIA2 "https://github.com/jenkins-infra/kubernetes-management/blob/main/clusters/cijioagents2.yaml"
    click ICIA "https://github.com/jenkins-infra/kubernetes-management/blob/main/clusters/infracijioagents1.yaml"
    click PVK8S "https://github.com/jenkins-infra/kubernetes-management/blob/main/clusters/privatek8s.yaml"
    click PBK8S "https://github.com/jenkins-infra/kubernetes-management/blob/main/clusters/publick8s.yaml"
    click IC "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/jenkins_infra.ci.jenkins.io.yaml"
    click RC "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/jenkins_release.ci.jenkins.io.yaml"
    click WC "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/jenkins_weekly.ci.jenkins.io.yaml"
    click PI "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/private-nginx-ingress__common.yaml"
    click PBI "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/public-nginx-ingress__common.yaml"
    click DD "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/datadog.yaml.gotmpl"
    click DDC1 "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/datadog_cijioagents1.yaml"
    click DDC2 "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/datadog_cijenkinsio-agents-2.yaml"
    click DDPV "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/datadog_privatek8s.yaml"
    click DDPB "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/datadog_publick8s.yaml"
    click KC "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/keycloak.yaml"
    click LDAP "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/ldap.yaml"
    click CM "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/cert-manager.yaml"
    click AA "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/accountapp.yaml"
    click CU "https://github.com/jenkins-infra/kubernetes-management/tree/main/updatecli/updatecli.d/charts/"
    click DI "https://github.com/jenkins-infra/kubernetes-management/tree/main/updatecli/updatecli.d/docker-images/"
    click JC "https://github.com/jenkins-infra/kubernetes-management/tree/main/updatecli/updatecli.d/jenkins-controllers/"
    click FALCO "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/falco.yaml"
    click ACME "https://github.com/jenkins-infra/kubernetes-management/blob/main/config/acme.yaml"
```
