Skip to content

Commit 3260f8b

Browse files
pau-hedgehogFrostman
authored andcommitted
Add architecture overview
Signed-off-by: Pau Capdevila <[email protected]>
1 parent f3e23be commit 3260f8b

File tree

1 file changed

+103
-2
lines changed

1 file changed

+103
-2
lines changed

docs/architecture/overview.md

Lines changed: 103 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,105 @@
11
# Overview
22

3-
!!! warning ""
4-
Under construction.
3+
Hedgehog Open Network Fabric leverages the Kubernetes API to manage its resources. All user-facing APIs are exposed as Kubernetes Custom Resources Definitions (CRDs), allowing users to manage Fabric resources using standard Kubernetes tools.
4+
5+
To make network switches Kubernetes-aware, the Fabric employs an **Agent** running on each switch. This agent acts as an interface between the Kubernetes control plane and the switch internal network configuration mechanisms. It continuously syncs desired state from Kubernetes via the Fabric Controller and applies configurations using **gNMI** (gRPC Network Management Interface).
6+
7+
## Components
8+
9+
Hedgehog Fabric consists of several key components, distributed between the Control Node and the Network devices. The following diagram breaks down the components of a [Collapsed Core](https://docs.githedgehog.com/latest/architecture/fabric/#collapsed-core). Hedgehog components have been highlighted in brown color:
10+
11+
``` mermaid
12+
graph TD;
13+
%% Control Plane
14+
subgraph Control Node ["Control Node"]
15+
K[Fabric CLI - kubectl plugin]:::ourComponent
16+
A[Fabric Controller]:::ourComponent
17+
P[Fabric Proxy]:::ourComponent
18+
end
19+
20+
K -->|Interacts via K8s API| A
21+
L[Fabricator]:::ourComponent -->|Installs & Configures| A
22+
A -->|Kubernetes API| B1
23+
B1 -->|Syncs State| A;
24+
A -->|Kubernetes API| B2
25+
B2 -->|Syncs State| A;
26+
27+
%% Collapsed Core - Two Switches
28+
subgraph SONiC Leaf 2
29+
B1[Fabric Agent]:::ourComponent -->|Scraped by| C1[Alloy]:::thirdParty
30+
C1 -->|Pushes Logs/Metrics| P
31+
D1[gNMI]:::thirdParty
32+
E1[Config DB]:::thirdParty
33+
I1[ASIC]:::thirdParty
34+
end
35+
36+
subgraph SONiC Leaf 1
37+
B2[Fabric Agent]:::ourComponent -->|Scraped by| C2[Alloy]:::thirdParty
38+
C2 -->|Pushes Logs/Metrics| P
39+
D2[gNMI]:::thirdParty
40+
E2[Config DB]:::thirdParty
41+
I2[ASIC]:::thirdParty
42+
end
43+
44+
%% Switch Configuration Flow
45+
B1 -->|Applies Config| D1
46+
B2 -->|Applies Config| D2
47+
D1 -->|Writes/Reads| E1
48+
D2 -->|Writes/Reads| E2
49+
E1 -->|Controls| I1
50+
E2 -->|Controls| I2
51+
52+
%% Logs and Metrics Flow
53+
P -->|Forwards Logs/Metrics| M
54+
M[LGTM]:::thirdParty
55+
56+
%% Style definitions for dark mode
57+
classDef ourComponent fill:#A67C52,stroke:#805D3B,stroke-width:2px,color:#ffffff;
58+
classDef thirdParty fill:#888888,stroke:#666666,stroke-width:1px,color:#000000;
59+
60+
%% Add a vertical legend
61+
subgraph Legend ["Legend"]
62+
direction RL
63+
HC[Hedgehog]:::ourComponent
64+
TPC[Third-Party]:::thirdParty
65+
end
66+
```
67+
68+
The key components essential for understanding the Fabric architecture are:
69+
70+
### Control Node Components
71+
- **Fabric Controller**: The central control plane component that manages Fabric resources and configurations.
72+
- **Fabric CLI (kubectl plugin)**: A `kubectl` plugin that provides an easy way to manage Fabric resources.
73+
- **Fabric Proxy**: A pod responsible for collecting logs and metrics from switches (via Alloy) and forwarding them to an external system.
74+
- **Fabricator**: A tool for installing and configuring Fabric, including virtual lab environments.
75+
76+
### SONiC Switch Components
77+
- **Fabric Agent**: Runs on each switch and applies configurations received from the control plane.
78+
- **Alloy**: Collects logs and telemetry data from the switch.
79+
- **gNMI Interface**: The main configuration API used by the Fabric Agent to interact with the switch.
80+
- **Config DB**: The central database in SONiC responsible for maintaining switch configuration.
81+
- **ASIC**: The hardware component handling packet forwarding.
82+
83+
The SONiC architecture presented here is a high-level abstraction, for simplicity.
84+
85+
## Architecture Flow
86+
87+
### 1. **Fabric Installation & Configuration**
88+
- The **Fabricator** tool installs and configures Hedgehog Fabric.
89+
- It provisions **Flatcar Linux** for Control Nodes and automatically installs **K3s** (lightweight Kubernetes).
90+
- All components, including their dependencies, are deployed within Kubernetes.
91+
92+
### 2. **Fabric API & Resource Management**
93+
- Hedgehog represents all infrastructure elements as **Fabric resources** using Kubernetes CRDs.
94+
- These CRDs define **switches, servers, control nodes, external systems, and their interconnections**.
95+
- The **Fabric Controller** watches these CRDs and manages configurations accordingly.
96+
97+
### 3. **Switch Configuration & Management**
98+
- The **Fabric Controller** communicates with the **Fabric Agent** on each switch via the Kubernetes API.
99+
- The **Fabric Agent** applies configurations using the **gNMI** interface, updating the **Config DB**.
100+
- The **Config DB** ensures that all settings are applied to the **ASIC** for packet forwarding.
101+
102+
### 4. **Telemetry & Monitoring**
103+
- The **Alloy** agent on the switch collects logs and metrics.
104+
- Logs and metrics are sent to the **Fabric Proxy** running in Kubernetes.
105+
- The **Fabric Proxy** forwards this data to **LGTM**, an external logging and monitoring system.

0 commit comments

Comments
 (0)