# openstack/magnum-capi-helm architecture

> Architecture diagram of the GitHub repository openstack/magnum-capi-helm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-19). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openstack/magnum-capi-helm
- Repository: https://github.com/openstack/magnum-capi-helm

## Overview

Magnum CAPI Helm is an OpenStack Magnum driver that provisions Kubernetes clusters through Cluster API, using Helm charts. Magnum’s driver entry point handles cluster lifecycle and delegates chart operations, Kubernetes API access, credential/certificate preparation, and health monitoring to internal modules. The documented chart capabilities include OpenStack-backed cluster resources, CNI, and monitoring add-ons. Edges reflect sampled imports/calls or README statements; chart internals and unsampled lifecycle details are not expanded.

Main entry points: [`magnum_capi_helm/driver.py`](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/driver.py) (Cluster driver), [`magnum_capi_helm/helm.py`](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/helm.py) (Helm operations), [`magnum_capi_helm/driver_utils.py`](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/driver_utils.py) (Cluster naming), [`magnum_capi_helm/kubernetes.py`](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/kubernetes.py) (Kubernetes API client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_magnum["Magnum integration"]
  node_driver["Cluster driver<br/>[driver.py]"]
  node_configuration["Driver configuration<br/>[conf.py]"]
end

subgraph group_provision["Cluster provisioning"]
  node_chart_ops["Helm operations<br/>[helm.py]"]
  node_driver_utils["Cluster naming<br/>[driver_utils.py]"]
  node_charts["CAPI Helm charts"]
  node_cluster_api[("Cluster API resources")]
  node_addons["CNI and monitoring add-ons"]
end

subgraph group_access["Kubernetes access"]
  node_k8s_client["Kubernetes API client<br/>[kubernetes.py]"]
  node_k8s_api[("Kubernetes API")]
end

subgraph group_support["Credentials and monitoring"]
  node_app_credentials["Application credentials<br/>[app_creds.py]"]
  node_openstack_identity[("OpenStack identity")]
  node_ca_certificates["Cluster certificates<br/>[ca_certificates.py]"]
  node_health_monitor["CAPI health monitor<br/>[capi_monitor.py]"]
end

node_magnum_user(("Magnum user"))

node_magnum_user -->|"requests lifecycle"| node_driver
node_driver -->|"manages releases"| node_chart_ops
node_driver -->|"queries resources"| node_k8s_client
node_driver -->|"uses naming helpers"| node_driver_utils
node_driver -->|"reads settings"| node_configuration
node_chart_ops -->|"reads settings"| node_configuration
node_driver_utils -->|"reads settings"| node_configuration
node_driver_utils -->|"checks release lock"| node_chart_ops
node_chart_ops -->|"uses lease API"| node_k8s_client
node_chart_ops -->|"installs charts"| node_charts
node_charts -->|"provisions resources"| node_cluster_api
node_charts -->|"includes add-ons"| node_addons
node_k8s_client -->|"reads and writes"| node_k8s_api
node_driver -->|"manages credentials"| node_app_credentials
node_app_credentials -->|"creates credentials"| node_openstack_identity
node_driver -->|"prepares certificates"| node_ca_certificates
node_driver -->|"checks cluster health"| node_health_monitor
node_health_monitor -->|"reads CAPI state"| node_k8s_client
node_health_monitor -->|"uses cluster names"| node_driver_utils

click node_driver "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/driver.py"
click node_configuration "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/conf.py"
click node_chart_ops "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/helm.py"
click node_driver_utils "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/driver_utils.py"
click node_k8s_client "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/kubernetes.py"
click node_app_credentials "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/common/app_creds.py"
click node_ca_certificates "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/common/ca_certificates.py"
click node_health_monitor "https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/common/capi_monitor.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_driver,node_configuration,node_magnum_user toneBlue
class node_chart_ops,node_driver_utils,node_charts,node_cluster_api,node_addons toneAmber
class node_k8s_client,node_k8s_api toneMint
class node_app_credentials,node_openstack_identity,node_ca_certificates,node_health_monitor toneRose
```

## Components

### Magnum integration

- [Cluster driver](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/driver.py): `magnum_capi_helm/driver.py`
- [Driver configuration](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/conf.py): `magnum_capi_helm/conf.py`

### Cluster provisioning

- [Helm operations](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/helm.py): `magnum_capi_helm/helm.py`
- [Cluster naming](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/driver_utils.py): `magnum_capi_helm/driver_utils.py`
- **CAPI Helm charts**
- **Cluster API resources**
- **CNI and monitoring add-ons**

### Kubernetes access

- [Kubernetes API client](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/kubernetes.py): `magnum_capi_helm/kubernetes.py`
- **Kubernetes API**

### Credentials and monitoring

- [Application credentials](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/common/app_creds.py): `magnum_capi_helm/common/app_creds.py`
- **OpenStack identity**
- [Cluster certificates](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/common/ca_certificates.py): `magnum_capi_helm/common/ca_certificates.py`
- [CAPI health monitor](https://github.com/openstack/magnum-capi-helm/blob/master/magnum_capi_helm/common/capi_monitor.py): `magnum_capi_helm/common/capi_monitor.py`

### Other components

- **Magnum user**

## Connections

- Magnum user → Cluster driver: requests lifecycle (evidence: `README.rst`)
- Cluster driver → Helm operations: manages releases (evidence: `magnum_capi_helm/driver.py`)
- Cluster driver → Kubernetes API client: queries resources (evidence: `magnum_capi_helm/driver.py`)
- Cluster driver → Cluster naming: uses naming helpers (evidence: `magnum_capi_helm/driver.py`)
- Cluster driver → Driver configuration: reads settings (evidence: `magnum_capi_helm/driver.py`)
- Helm operations → Driver configuration: reads settings (evidence: `magnum_capi_helm/helm.py`)
- Cluster naming → Driver configuration: reads settings (evidence: `magnum_capi_helm/driver_utils.py`)
- Cluster naming → Helm operations: checks release lock (evidence: `magnum_capi_helm/driver_utils.py`)
- Helm operations → Kubernetes API client: uses lease API (evidence: `magnum_capi_helm/helm.py`)
- Helm operations → CAPI Helm charts: installs charts (evidence: `README.rst`)
- CAPI Helm charts → Cluster API resources: provisions resources (evidence: `README.rst`)
- CAPI Helm charts → CNI and monitoring add-ons: includes add-ons (evidence: `README.rst`)
- Kubernetes API client → Kubernetes API: reads and writes (evidence: `magnum_capi_helm/kubernetes.py`)
- Cluster driver → Application credentials: manages credentials (evidence: `magnum_capi_helm/driver.py`)
- Application credentials → OpenStack identity: creates credentials (evidence: `magnum_capi_helm/common/app_creds.py`)
- Cluster driver → Cluster certificates: prepares certificates (evidence: `magnum_capi_helm/driver.py`)
- Cluster driver → CAPI health monitor: checks cluster health (evidence: `magnum_capi_helm/driver.py`)
- CAPI health monitor → Kubernetes API client: reads CAPI state (evidence: `magnum_capi_helm/common/capi_monitor.py`)
- CAPI health monitor → Cluster naming: uses cluster names (evidence: `magnum_capi_helm/common/capi_monitor.py`)
