# netcracker/kubemarine architecture

> Architecture diagram of the GitHub repository netcracker/kubemarine, 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/netcracker/kubemarine
- Repository: https://github.com/netcracker/kubemarine

## Overview

Kubemarine is a CLI and Python-extensible tool for Kubernetes cluster deployment and lifecycle maintenance. The principal workflow takes an operator’s procedure and cluster inventory, constructs an execution context, runs staged tasks against remote nodes, and reports cluster checks or maintenance results. Procedures cover installation, node changes, upgrades, backup/restore, reconfiguration, and other maintenance; system preparation, Kubernetes components, packages, and plugins provide operational capabilities. The README documents these branches; sampled excerpts only support some internal wiring, so uncertain procedure-to-subsystem links are omitted.

Main entry points: [`kubemarine/core/group.py`](https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/group.py) (Remote execution), [`kubemarine/core/cluster.py`](https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/cluster.py) (Cluster context), [`kubemarine/procedures/__init__.py`](https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/__init__.py) (Procedure dispatch), [`kubemarine/procedures/install.py`](https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/install.py) (Install workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI and workflows"]
  node_cli["CLI entry<br/>[__main__.py]"]
  node_procedures["Procedure dispatch<br/>[__init__.py]"]
  node_install["Install workflow<br/>[install.py]"]
  node_maintenance["Maintenance workflows"]
end

subgraph group_runtime["Execution runtime"]
  node_inventory["Cluster inventory<br/>[inventory.py]"]
  node_cluster["Cluster context<br/>[cluster.py]"]
  node_flow["Task flow<br/>[flow.py]"]
  node_actions["Action framework<br/>[action.py]"]
  node_remote["Remote execution<br/>[group.py]"]
end

subgraph group_clusterops["Cluster operations"]
  node_system["System preparation<br/>[system.py]"]
  node_packages["Package management<br/>[packages.py]"]
  node_kubernetes["Kubernetes lifecycle<br/>[__init__.py]"]
  node_containerd["Container runtime<br/>[containerd.py]"]
end

subgraph group_checks["Validation"]
  node_checks_iaas["Infrastructure checks<br/>[check_iaas.py]"]
  node_checks_paas["Cluster health checks<br/>[check_paas.py]"]
end

subgraph group_extensions["Plugins"]
  node_plugin_api["Plugin framework<br/>[__init__.py]"]
  node_builtin_plugins["Built-in plugins<br/>[builtin.py]"]
end

node_operator(("Operator"))
node_nodes(("Managed nodes"))
node_external_cluster(("Kubernetes services"))

node_operator -->|"invokes"| node_cli
node_cli -->|"dispatches"| node_procedures
node_procedures -->|"selects"| node_install
node_procedures -->|"selects"| node_maintenance
node_install -->|"runs tasks"| node_flow
node_maintenance -->|"runs tasks"| node_flow
node_install -->|"loads configuration"| node_inventory
node_maintenance -->|"uses configuration"| node_inventory
node_flow -->|"dispatches"| node_actions
node_actions -->|"operates on"| node_cluster
node_cluster -->|"uses"| node_inventory
node_system -->|"executes remotely"| node_remote
node_packages -->|"executes remotely"| node_remote
node_kubernetes -->|"executes remotely"| node_remote
node_containerd -->|"executes remotely"| node_remote
node_remote -->|"runs commands"| node_nodes
node_checks_iaas -->|"checks infrastructure"| node_cluster
node_checks_iaas -->|"probes nodes"| node_remote
node_checks_paas -->|"checks services"| node_cluster
node_checks_paas -->|"queries cluster"| node_remote
node_plugin_api -->|"applies extensions"| node_cluster
node_builtin_plugins -->|"registers plugins"| node_plugin_api
node_plugin_api -->|"installs components"| node_external_cluster

click node_cli "https://github.com/netcracker/kubemarine/blob/main/kubemarine/__main__.py"
click node_procedures "https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/__init__.py"
click node_install "https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/install.py"
click node_maintenance "https://github.com/netcracker/kubemarine/tree/main/kubemarine/procedures"
click node_inventory "https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/inventory.py"
click node_cluster "https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/cluster.py"
click node_flow "https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/flow.py"
click node_actions "https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/action.py"
click node_remote "https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/group.py"
click node_system "https://github.com/netcracker/kubemarine/blob/main/kubemarine/system.py"
click node_packages "https://github.com/netcracker/kubemarine/blob/main/kubemarine/packages.py"
click node_kubernetes "https://github.com/netcracker/kubemarine/blob/main/kubemarine/kubernetes/__init__.py"
click node_containerd "https://github.com/netcracker/kubemarine/blob/main/kubemarine/cri/containerd.py"
click node_checks_iaas "https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/check_iaas.py"
click node_checks_paas "https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/check_paas.py"
click node_plugin_api "https://github.com/netcracker/kubemarine/blob/main/kubemarine/plugins/__init__.py"
click node_builtin_plugins "https://github.com/netcracker/kubemarine/blob/main/kubemarine/plugins/builtin.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_cli,node_procedures,node_install,node_maintenance toneBlue
class node_inventory,node_cluster,node_flow,node_actions,node_remote toneAmber
class node_system,node_packages,node_kubernetes,node_containerd toneMint
class node_checks_iaas,node_checks_paas toneRose
class node_plugin_api,node_builtin_plugins,node_operator,node_nodes,node_external_cluster toneIndigo
```

## Components

### CLI and workflows

- [CLI entry](https://github.com/netcracker/kubemarine/blob/main/kubemarine/__main__.py): `kubemarine/__main__.py`
- [Procedure dispatch](https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/__init__.py): `kubemarine/procedures/__init__.py`
- [Install workflow](https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/install.py): `kubemarine/procedures/install.py`
- [Maintenance workflows](https://github.com/netcracker/kubemarine/tree/main/kubemarine/procedures): `kubemarine/procedures`

### Execution runtime

- [Cluster inventory](https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/inventory.py): `kubemarine/core/inventory.py`
- [Cluster context](https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/cluster.py): `kubemarine/core/cluster.py`
- [Task flow](https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/flow.py): `kubemarine/core/flow.py`
- [Action framework](https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/action.py): `kubemarine/core/action.py`
- [Remote execution](https://github.com/netcracker/kubemarine/blob/main/kubemarine/core/group.py): `kubemarine/core/group.py`

### Cluster operations

- [System preparation](https://github.com/netcracker/kubemarine/blob/main/kubemarine/system.py): `kubemarine/system.py`
- [Package management](https://github.com/netcracker/kubemarine/blob/main/kubemarine/packages.py): `kubemarine/packages.py`
- [Kubernetes lifecycle](https://github.com/netcracker/kubemarine/blob/main/kubemarine/kubernetes/__init__.py): `kubemarine/kubernetes/__init__.py`
- [Container runtime](https://github.com/netcracker/kubemarine/blob/main/kubemarine/cri/containerd.py): `kubemarine/cri/containerd.py`

### Validation

- [Infrastructure checks](https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/check_iaas.py): `kubemarine/procedures/check_iaas.py`
- [Cluster health checks](https://github.com/netcracker/kubemarine/blob/main/kubemarine/procedures/check_paas.py): `kubemarine/procedures/check_paas.py`

### Plugins

- [Plugin framework](https://github.com/netcracker/kubemarine/blob/main/kubemarine/plugins/__init__.py): `kubemarine/plugins/__init__.py`
- [Built-in plugins](https://github.com/netcracker/kubemarine/blob/main/kubemarine/plugins/builtin.py): `kubemarine/plugins/builtin.py`

### Other components

- **Operator**
- **Managed nodes**
- **Kubernetes services**

## Connections

- Operator → CLI entry: invokes
- CLI entry → Procedure dispatch: dispatches
- Procedure dispatch → Install workflow: selects
- Procedure dispatch → Maintenance workflows: selects
- Install workflow → Task flow: runs tasks
- Maintenance workflows → Task flow: runs tasks
- Install workflow → Cluster inventory: loads configuration
- Maintenance workflows → Cluster inventory: uses configuration
- Task flow → Action framework: dispatches
- Action framework → Cluster context: operates on
- Cluster context → Cluster inventory: uses
- System preparation → Remote execution: executes remotely
- Package management → Remote execution: executes remotely
- Kubernetes lifecycle → Remote execution: executes remotely
- Container runtime → Remote execution: executes remotely
- Remote execution → Managed nodes: runs commands
- Infrastructure checks → Cluster context: checks infrastructure
- Infrastructure checks → Remote execution: probes nodes
- Cluster health checks → Cluster context: checks services
- Cluster health checks → Remote execution: queries cluster
- Plugin framework → Cluster context: applies extensions
- Built-in plugins → Plugin framework: registers plugins
- Plugin framework → Kubernetes services: installs components
