|
| 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 underlay. |
| 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 | +## **Component 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 (FC)**. |
| 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. |
| 74 | + |
| 75 | +### **SONiC Switch Components** |
| 76 | +- **Fabric Agent:** Receives configurations from the Fabric Controller and applies them to the SONiC switches via gNMI. |
| 77 | +- **Alloy:** Monitors SONiC and reports metrics. |
| 78 | +- **SONiC Config DB:** Stores and manages switch configuration data. |
| 79 | + |
| 80 | +### **Monitoring** |
| 81 | +- Logs and metrics from SONiC are collected and sent to [Loki](https://grafana.com/oss/loki/), [Grafana](https://grafana.com), [Tempo](https://grafana.com/oss/tempo/), and [Mimir](https://grafana.com/oss/mimir/) for visualization and analysis. |
| 82 | + |
| 83 | +--- |
| 84 | + |
| 85 | +## **GitOps Functionality (ArgoCD)** |
| 86 | + |
| 87 | +All explanations related to GitOps using [ArgoCD](https://argo-cd.readthedocs.io/en/stable/) are provided in this section. |
| 88 | + |
| 89 | +- **User Actions:** |
| 90 | + - The user **creates Fabric CR YAMLs** and pushes them to a [Git repository](https://git-scm.com) for version control. |
| 91 | +- **ArgoCD Actions:** |
| 92 | + - [ArgoCD](https://argo-cd.readthedocs.io/en/stable/) monitors the Git repository. |
| 93 | + - ArgoCD **pulls the CRs from Git** and applies them to [Kubernetes](https://kubernetes.io) via the Kubernetes API Server. |
| 94 | + |
| 95 | +```mermaid |
| 96 | +graph TD |
| 97 | +
|
| 98 | +%% Define the nodes (GitOps includes Git & ArgoCD) |
| 99 | +User[User] |
| 100 | +Kubectl[kubectl] |
| 101 | + Git[Git Repository] |
| 102 | +ArgoCD[ArgoCD] |
| 103 | +
|
| 104 | +%% Control Node components |
| 105 | +subgraph ControlNode["Control Node"] |
| 106 | + K8S[Kubernetes API Server] |
| 107 | + FC[Fabric Controller] |
| 108 | +end |
| 109 | +
|
| 110 | +%% Define the relationships |
| 111 | +User -->|Fabric CR YAMLs| Git |
| 112 | +Kubectl -.->|Direct kubectl commands| K8S |
| 113 | +User -.->|CLI| Kubectl |
| 114 | +Git -.->|ArgoCD pulls| ArgoCD |
| 115 | +ArgoCD -->|Applies CRs| K8S |
| 116 | +K8S -->|Sends CRDs| FC |
| 117 | +``` |
0 commit comments