Skip to content

Commit 25c0ab0

Browse files
committed
(architecture): add Fabric Management page
Signed-off-by: Pau Capdevila <[email protected]>
1 parent c64a87d commit 25c0ab0

File tree

2 files changed

+123
-0
lines changed

2 files changed

+123
-0
lines changed

docs/architecture/.pages

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
nav:
22
- Overview: overview.md
3+
- Fabric Management: management.md
34
- Fabric Implementation: fabric.md
45
- ...

docs/architecture/management.md

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Fabric Management
2+
3+
The installation of a Hedgehog Fabric deployment is carried out using Fabricator (hhfab CLI). Once deployed, ongoing operations are managed via the [Kubernetes](https://kubernetes.io) CLI, [`kubectl`](https://kubernetes.io/docs/reference/kubectl/).
4+
5+
In this workflow, the Kubernetes API Server processes the Fabric Custom Resources (CRs) and forwards them to the Fabric Controller. The Fabric Controller then generates the required SONiC configurations and dispatches them to the Fabric Agent, which applies these configurations to the SONiC Config DB via gNMI. Simultaneously, Alloy collects metrics and logs from the SONiC switches, sending this information to the monitoring tools for continuous monitoring.
6+
7+
The diagram below illustrates the general workflow for fabric management as well as the interactions between control plane components and the SONiC switches that form the Fabric.
8+
9+
```mermaid
10+
graph TD
11+
12+
%% Define the nodes (General Workflow excludes Git & ArgoCD)
13+
User[User]
14+
Kubectl[kubectl]
15+
Fabricator[Fabricator]
16+
17+
%% Control Node components
18+
subgraph ControlNode["Control Node"]
19+
K8S[Kubernetes API Server]
20+
FC[Fabric Controller]
21+
K9s[K9s]
22+
KubectlFabric["kubectl fabric"]
23+
end
24+
25+
%% SONiC Switch components
26+
subgraph SONiCSwitch["SONiC Switch"]
27+
FA[Fabric Agent]
28+
Alloy[Alloy]
29+
DB[SONiC Config DB]
30+
end
31+
32+
%% External monitoring
33+
Monitoring[Loki/Grafana/Tempo/Mimir]
34+
35+
%% Define the relationships
36+
Kubectl -.->|Direct kubectl commands| K8S
37+
User -.->|CLI| Fabricator
38+
User -.->|CLI| Kubectl
39+
Kubectl -.->|Plugin| KubectlFabric
40+
Fabricator -->|SSH access| K9s
41+
Fabricator -->|Applies CRs| K8S
42+
KubectlFabric -->|Interacts with| K8S
43+
K9s -->|UI Manages| K8S
44+
K8S -->|Sends CRDs| FC
45+
FC -->|Generates SONiC Configs| FA
46+
FA -->|Applies Config via gNMI| DB
47+
FA -->|Reports Metrics| Alloy
48+
Alloy -->|Sends Logs & Metrics| Monitoring
49+
```
50+
51+
---
52+
53+
## **Management Workflow Overview**
54+
55+
### **User**
56+
- **Creates Fabric CR YAMLs** and commits them to version control.
57+
- **Directly interacts with SONiC switches** via the Fabricator CLI.
58+
- **Uses [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) and `kubectl fabric`** to interact with the Kubernetes API for fabric resource management.
59+
60+
### **Kubernetes API Server (K8S)**
61+
- Part of [Kubernetes](https://kubernetes.io).
62+
- Manages Fabric Custom Resources (CRs) and interacts with the **Fabric Controller**.
63+
64+
### **kubectl & kubectl fabric**
65+
- [`kubectl`](https://kubernetes.io/docs/reference/kubectl/) is the standard CLI tool for [Kubernetes](https://kubernetes.io).
66+
- `kubectl fabric` is a plugin that extends `kubectl` with fabric-specific commands and interacts with the Kubernetes API Server.
67+
68+
### **Fabricator**
69+
- CLI tool that provides direct interaction with the Kubernetes API.
70+
- Can apply configurations via **SSH access** (using **K9s**) or by directly managing Fabric CRs with YAML files.
71+
72+
### **K9s**
73+
- A Kubernetes UI that provides visibility and control over Kubernetes resources, allowing you to manage pods, nodes, services, logs, and Fabric resources efficiently. It includes some helper plugins:
74+
- **SSH** – SSH into a fabric switch
75+
- **Serial** – Open a serial connection to a fabric switch
76+
- **Reboot** – Reboot a fabric switch
77+
- **Power Reset** Perform a power reset on a fabric switch in the NOS
78+
- **Reinstall** – Reinstall a fabric switch
79+
80+
### **SONiC Switch Relevant Components**
81+
- **Fabric Agent:** Receives configurations from the Fabric Controller and applies them to the SONiC switches via gNMI.
82+
- **Alloy:** Monitors SONiC and reports metrics.
83+
- **SONiC Config DB:** Stores and manages switch configuration data.
84+
85+
### **Monitoring**
86+
- Logs and metrics from SONiC are collected and sent to [Loki](https://grafana.com/oss/loki/) and [Mimir](https://grafana.com/oss/mimir/) for visualization and analysis through [Grafana](https://grafana.com).
87+
88+
---
89+
90+
## **GitOps Functionality (ArgoCD)**
91+
92+
GitOps workflows can be leveraged using [ArgoCD](https://argo-cd.readthedocs.io/en/stable/). This is an alternative approach to show that a Fabric can be used with industry standard tools seamlessly.
93+
94+
- **User Actions:**
95+
- The user **creates Fabric CR YAMLs** and pushes them to a [Git repository](https://git-scm.com) for version control.
96+
- **ArgoCD Actions:**
97+
- [ArgoCD](https://argo-cd.readthedocs.io/en/stable/) monitors the Git repository.
98+
- ArgoCD **pulls the CRs from Git** and applies them to [Kubernetes](https://kubernetes.io) via the Kubernetes API Server.
99+
100+
```mermaid
101+
graph TD
102+
103+
%% Define the nodes (GitOps includes Git & ArgoCD)
104+
User[User]
105+
Kubectl[kubectl]
106+
Git[Git Repository]
107+
ArgoCD[ArgoCD]
108+
109+
%% Control Node components
110+
subgraph ControlNode["Control Node"]
111+
K8S[Kubernetes API Server]
112+
FC[Fabric Controller]
113+
end
114+
115+
%% Define the relationships
116+
User -->|Fabric CR YAMLs| Git
117+
Kubectl -.->|Direct kubectl commands| K8S
118+
User -.->|CLI| Kubectl
119+
Git -.->|ArgoCD pulls| ArgoCD
120+
ArgoCD -->|Applies CRs| K8S
121+
K8S -->|Sends CRDs| FC
122+
```

0 commit comments

Comments
 (0)