|
| 1 | +# Fabric Management |
| 2 | + |
| 3 | +This document describes the architecture for managing Hedgehog Fabric deployments using Kubernetes, `kubectl`, and supporting tools. The diagram below illustrates the interactions between components in the control plane and the SONiC switches. |
| 4 | + |
| 5 | +```mermaid |
| 6 | +graph TD |
| 7 | +
|
| 8 | +%% Define the nodes |
| 9 | +User[User] |
| 10 | +Kubectl[kubectl] |
| 11 | +Fabricator[Fabricator] |
| 12 | +Git[Git Repository] |
| 13 | +ArgoCD[ArgoCD] |
| 14 | +
|
| 15 | +%% Control Node components |
| 16 | +subgraph ControlNode["Control Node"] |
| 17 | + K8S[Kubernetes API Server] |
| 18 | + FC[Fabric Controller] |
| 19 | + K9s[K9s] |
| 20 | + KubectlFabric["kubectl fabric"] |
| 21 | +end |
| 22 | +
|
| 23 | +%% SONiC Switch components |
| 24 | +subgraph SONiCSwitch["SONiC Switch"] |
| 25 | + FA[Fabric Agent] |
| 26 | + Alloy[Alloy] |
| 27 | + DB[SONiC Config DB] |
| 28 | +end |
| 29 | +
|
| 30 | +%% External monitoring |
| 31 | +Monitoring[Loki/Grafana/Tempo/Mimir] |
| 32 | +
|
| 33 | +%% Define the relationships |
| 34 | +User -->|Fabric CR YAMLs| Git |
| 35 | +Kubectl -.->|Direct kubectl commands| K8S |
| 36 | +User -.->|CLI| Fabricator |
| 37 | +User -.->|CLI| Kubectl |
| 38 | +Kubectl -.->|Plugin| KubectlFabric |
| 39 | +Fabricator -->|SSH access| K9s |
| 40 | +Fabricator -->|Applies CRs| K8S |
| 41 | +KubectlFabric -->|Interacts with| K8S |
| 42 | +K9s -->|UI Manages| K8S |
| 43 | +Git -.->|ArgoCD pulls| ArgoCD |
| 44 | +ArgoCD -->|Applies CRs| K8S |
| 45 | +K8S -->|Sends CRDs| FC |
| 46 | +FC -->|Generates SONiC Configs| FA |
| 47 | +FA -->|Applies Config via gNMI| DB |
| 48 | +FA -->|Reports Metrics| Alloy |
| 49 | +Alloy -->|Sends Logs & Metrics| Monitoring |
| 50 | +
|
| 51 | +%% Styling |
| 52 | +classDef ourComponent fill:#F4E1C1,stroke:#B38A56,stroke-width:2px |
| 53 | +classDef thirdParty fill:#e6e6e6,stroke:#999999,stroke-width:1px |
| 54 | +
|
| 55 | +%% Apply styles |
| 56 | +class User,Git,ArgoCD,DB,Monitoring,Alloy,K9s,Kubectl,K8S thirdParty |
| 57 | +class FC,FA,Fabricator,KubectlFabric ourComponent |
| 58 | +``` |
| 59 | + |
| 60 | +--- |
| 61 | + |
| 62 | +## **Component Overview** |
| 63 | + |
| 64 | +### **User** |
| 65 | +The user interacts with the system via multiple interfaces: |
| 66 | +- **Creates Fabric CR YAMLs** and commits them to **Git** for version control and automation. |
| 67 | +- **Directly interacts with SONiC switches** via the Fabricator CLI. |
| 68 | +- **Uses `kubectl` and `kubectl fabric`** to interact with Kubernetes for fabric resource management. |
| 69 | + |
| 70 | +### **Git & ArgoCD** |
| 71 | +ArgoCD is not part of the Fabric but shown as an example on how to manage a fabric with standard GitOps tools: |
| 72 | +- Users **push Fabric Custom Resources (CRs) to Git**. |
| 73 | +- ArgoCD **pulls CRs from Git** and applies them to Kubernetes. |
| 74 | + |
| 75 | +### **Kubernetes API Server (K8S)** |
| 76 | +- Manages Fabric CRs and interacts with the **Fabric Controller (FC)**. |
| 77 | +- FC processes CRs and generates necessary SONiC configurations. |
| 78 | + |
| 79 | +### **kubectl & kubectl fabric** |
| 80 | +- `kubectl` is the standard CLI for Kubernetes. |
| 81 | +- `kubectl fabric` is a **plugin** that extends `kubectl` with fabric-specific commands. |
| 82 | +- `kubectl fabric` interacts with the **Kubernetes API Server** to manage Fabric resources. |
| 83 | + |
| 84 | +### **Fabricator** |
| 85 | +- CLI tool that provides direct interaction with the kubernetes API. |
| 86 | +- Can apply configurations via **SSH access to the control node and invoking K9s** or **directly manage fabric CRs** with YAML input files. |
| 87 | + |
| 88 | +### **K9s** |
| 89 | +- A Kubernetes UI that provides visibility and control over Kubernetes resources. |
| 90 | + |
| 91 | +### **SONiC Switch Components** |
| 92 | +- **Fabric Agent:** Receives configurations from the Fabric Controller and and applies them to the SONiC via gNMI. |
| 93 | +- **Alloy:** Monitors SONiC and reports metrics. |
| 94 | +- **SONiC Config DB:** Stores and manages switch configuration. |
| 95 | + |
| 96 | +### **Monitoring** |
| 97 | +- Logs and metrics from SONiC are collected and sent to **Loki, and Mimir** for visualization and analysis through **Grafana**. |
| 98 | + |
| 99 | +--- |
| 100 | + |
| 101 | +## **Flow of Operations** |
| 102 | +1. **User defines Fabric CRs** and pushes them to **Git**. |
| 103 | +2. **ArgoCD syncs the CRs** and applies them to **Kubernetes**. |
| 104 | +3. **The Kubernetes API Server processes the CRs** and passes them to the **Fabric Controller**. |
| 105 | +4. **The Fabric Controller generates SONiC configurations** and sends them to the **Fabric Agent**. |
| 106 | +5. **The Fabric Agent applies configurations** to the **SONiC Config DB** via gNMI. |
| 107 | +6. **Alloy collects metrics and logs** from SONiC and sends them to **monitoring tools**. |
0 commit comments