# nephio-project/nephio architecture

> Architecture diagram of the GitHub repository nephio-project/nephio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nephio-project/nephio
- Repository: https://github.com/nephio-project/nephio

## Overview

Nephio automates network-function and infrastructure provisioning through Kubernetes controllers, package-rendering functions, and provisioning APIs. A typical request is accepted and validated, rendered as a package variant, then monitored as cluster resources are created. The repository also contains independent KRM functions for configuration and network-resource generation, and an operator northbound interface with selectable storage. The README describes the platform broadly; the component wiring below is based on the tree and sampled excerpts, so uncertain function-to-function sequencing is not shown.

Main entry points: [`controllers/pkg/reconcilers`](https://github.com/nephio-project/nephio/tree/main/controllers/pkg/reconcilers) (Nephio Reconcilers), [`operators/o2ims-operator/controllers/manager.py`](https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/manager.py) (Request Handler), [`operators/o2ims-operator/controllers/provisioning_request_controller.py`](https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/provisioning_request_controller.py) (Cluster Provisioning), [`operators/focom-operator/internal/nbi/services`](https://github.com/nephio-project/nephio/tree/main/operators/focom-operator/internal/nbi/services) (NBI Services)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_provisioning["Provisioning APIs"]
  node_o2api["O2 IMS API"]
  node_o2handler["Request Handler<br/>[manager.py]"]
  node_o2validate["Request Validation"]
  node_o2provision["Cluster Provisioning"]
  node_focomapi["FOCOM NBI<br/>[router.go]"]
  node_nbi_services["NBI Services"]
  node_nbi_validation["NBI Validation"]
  node_nbi_storage[("NBI Storage")]
  node_focom_storage["FOCOM Storage Model<br/>[storage.go]"]
end

subgraph group_controllers["Kubernetes Controllers"]
  node_focom_controller["FOCOM Reconciler"]
  node_nephio_manager["Controller Manager<br/>[main.go]"]
  node_reconcilers["Nephio Reconcilers"]
end

subgraph group_packages["Package Functions"]
  node_kpt_functions["Network KRM Functions<br/>[function.go]"]
  node_deployment_functions["NF Deployment Functions<br/>[function.go]"]
  node_config_functions["Configuration Functions<br/>[function.go]"]
  node_kustomize_function["Kustomize Resources<br/>[main.go]"]
end

subgraph group_integration["Platform Integrations"]
  node_porch_client["Porch Client<br/>[client.go]"]
  node_git_client["Git Providers<br/>[client.go]"]
end

node_user(("Provisioning Client"))
node_k8s[("Kubernetes API")]
node_porch["Porch Package System"]

node_user -->|"submits request"| node_o2api
node_o2api -->|"dispatches"| node_o2handler
node_o2handler -->|"validates"| node_o2validate
node_o2handler -->|"starts provisioning"| node_o2provision
node_o2provision -->|"creates package variant"| node_porch
node_o2provision -->|"checks cluster status"| node_k8s
node_focomapi -->|"dispatches requests"| node_nbi_services
node_nbi_services -->|"validates data"| node_nbi_validation
node_nbi_services -->|"reads and writes"| node_nbi_storage
node_nbi_storage -->|"stores revisions"| node_focom_storage
node_nephio_manager -->|"sets up"| node_reconcilers
node_nephio_manager -->|"creates clients"| node_porch_client
node_reconcilers -->|"reconciles resources"| node_k8s
node_reconcilers -->|"uses package APIs"| node_porch_client
node_reconcilers -->|"accesses repositories"| node_git_client
node_focom_controller -->|"reads and updates"| node_k8s
node_focom_controller -->|"builds remote client"| node_focomapi
node_kpt_functions -.->|"uses IPAM proxy"| node_k8s
node_deployment_functions -->|"renders deployment resources"| node_k8s
node_config_functions -->|"transforms resource lists"| node_k8s
node_kustomize_function -->|"updates resource list"| node_k8s

click node_o2api "https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/northbound_restapi.py"
click node_o2handler "https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/manager.py"
click node_o2validate "https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/provisioning_request_validation_controller.py"
click node_o2provision "https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/provisioning_request_controller.py"
click node_focomapi "https://github.com/nephio-project/nephio/blob/main/operators/focom-operator/internal/nbi/handlers/router.go"
click node_nbi_services "https://github.com/nephio-project/nephio/tree/main/operators/focom-operator/internal/nbi/services"
click node_nbi_validation "https://github.com/nephio-project/nephio/tree/main/operators/focom-operator/internal/nbi/validation"
click node_nbi_storage "https://github.com/nephio-project/nephio/tree/main/operators/focom-operator/internal/nbi/storage"
click node_focom_controller "https://github.com/nephio-project/nephio/blob/main/operators/focom-operator/internal/controller/focomprovisioningrequest_controller.go"
click node_nephio_manager "https://github.com/nephio-project/nephio/blob/main/operators/nephio-controller-manager/main.go"
click node_reconcilers "https://github.com/nephio-project/nephio/tree/main/controllers/pkg/reconcilers"
click node_porch_client "https://github.com/nephio-project/nephio/blob/main/controllers/pkg/porch/client/client.go"
click node_git_client "https://github.com/nephio-project/nephio/blob/main/controllers/pkg/git/client.go"
click node_kpt_functions "https://github.com/nephio-project/nephio/blob/main/krm-functions/ipam-fn/fn/function.go"
click node_deployment_functions "https://github.com/nephio-project/nephio/blob/main/krm-functions/nfdeploy-fn/fn/function.go"
click node_config_functions "https://github.com/nephio-project/nephio/blob/main/krm-functions/configinject-fn/fn/function.go"
click node_kustomize_function "https://github.com/nephio-project/nephio/blob/main/krm-functions/gen-kustomize-res/main.go"
click node_focom_storage "https://github.com/nephio-project/nephio/blob/main/operators/focom-operator/internal/nbi/models/storage.go"

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_o2api,node_o2handler,node_o2validate,node_o2provision,node_focomapi,node_nbi_services,node_nbi_validation,node_nbi_storage,node_focom_storage,node_user toneBlue
class node_focom_controller,node_nephio_manager,node_reconcilers,node_k8s toneAmber
class node_kpt_functions,node_deployment_functions,node_config_functions,node_kustomize_function toneMint
class node_porch_client,node_git_client toneRose
class node_porch toneIndigo
```

## Components

### Provisioning APIs

- [O2 IMS API](https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/northbound_restapi.py): `operators/o2ims-operator/controllers/northbound_restapi.py`
- [Request Handler](https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/manager.py): `operators/o2ims-operator/controllers/manager.py`
- [Request Validation](https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/provisioning_request_validation_controller.py): `operators/o2ims-operator/controllers/provisioning_request_validation_controller.py`
- [Cluster Provisioning](https://github.com/nephio-project/nephio/blob/main/operators/o2ims-operator/controllers/provisioning_request_controller.py): `operators/o2ims-operator/controllers/provisioning_request_controller.py`
- [FOCOM NBI](https://github.com/nephio-project/nephio/blob/main/operators/focom-operator/internal/nbi/handlers/router.go): `operators/focom-operator/internal/nbi/handlers/router.go`
- [NBI Services](https://github.com/nephio-project/nephio/tree/main/operators/focom-operator/internal/nbi/services): `operators/focom-operator/internal/nbi/services`
- [NBI Validation](https://github.com/nephio-project/nephio/tree/main/operators/focom-operator/internal/nbi/validation): `operators/focom-operator/internal/nbi/validation`
- [NBI Storage](https://github.com/nephio-project/nephio/tree/main/operators/focom-operator/internal/nbi/storage): `operators/focom-operator/internal/nbi/storage`
- [FOCOM Storage Model](https://github.com/nephio-project/nephio/blob/main/operators/focom-operator/internal/nbi/models/storage.go): `operators/focom-operator/internal/nbi/models/storage.go`

### Kubernetes Controllers

- [FOCOM Reconciler](https://github.com/nephio-project/nephio/blob/main/operators/focom-operator/internal/controller/focomprovisioningrequest_controller.go): `operators/focom-operator/internal/controller/focomprovisioningrequest_controller.go`
- [Controller Manager](https://github.com/nephio-project/nephio/blob/main/operators/nephio-controller-manager/main.go): `operators/nephio-controller-manager/main.go`
- [Nephio Reconcilers](https://github.com/nephio-project/nephio/tree/main/controllers/pkg/reconcilers): `controllers/pkg/reconcilers`

### Package Functions

- [Network KRM Functions](https://github.com/nephio-project/nephio/blob/main/krm-functions/ipam-fn/fn/function.go): `krm-functions/ipam-fn/fn/function.go`
- [NF Deployment Functions](https://github.com/nephio-project/nephio/blob/main/krm-functions/nfdeploy-fn/fn/function.go): `krm-functions/nfdeploy-fn/fn/function.go`
- [Configuration Functions](https://github.com/nephio-project/nephio/blob/main/krm-functions/configinject-fn/fn/function.go): `krm-functions/configinject-fn/fn/function.go`
- [Kustomize Resources](https://github.com/nephio-project/nephio/blob/main/krm-functions/gen-kustomize-res/main.go): `krm-functions/gen-kustomize-res/main.go`

### Platform Integrations

- [Porch Client](https://github.com/nephio-project/nephio/blob/main/controllers/pkg/porch/client/client.go): `controllers/pkg/porch/client/client.go`
- [Git Providers](https://github.com/nephio-project/nephio/blob/main/controllers/pkg/git/client.go): `controllers/pkg/git/client.go`

### Other components

- **Provisioning Client**
- **Kubernetes API**
- **Porch Package System**

## Connections

- Provisioning Client → O2 IMS API: submits request
- O2 IMS API → Request Handler: dispatches
- Request Handler → Request Validation: validates
- Request Handler → Cluster Provisioning: starts provisioning
- Cluster Provisioning → Porch Package System: creates package variant
- Cluster Provisioning → Kubernetes API: checks cluster status
- FOCOM NBI → NBI Services: dispatches requests
- NBI Services → NBI Validation: validates data
- NBI Services → NBI Storage: reads and writes
- NBI Storage → FOCOM Storage Model: stores revisions
- Controller Manager → Nephio Reconcilers: sets up
- Controller Manager → Porch Client: creates clients
- Nephio Reconcilers → Kubernetes API: reconciles resources
- Nephio Reconcilers → Porch Client: uses package APIs
- Nephio Reconcilers → Git Providers: accesses repositories
- FOCOM Reconciler → Kubernetes API: reads and updates
- FOCOM Reconciler → FOCOM NBI: builds remote client
- Network KRM Functions → Kubernetes API: uses IPAM proxy
- NF Deployment Functions → Kubernetes API: renders deployment resources
- Configuration Functions → Kubernetes API: transforms resource lists
- Kustomize Resources → Kubernetes API: updates resource list
