Containerlab

The purpose of this deployment is to achieve redundancy, high-availability and data aggregation via clustering.

This deployment example includes:

The leader election and target distribution is done with the help of a Consul server

All members of the cluster expose a gNMI Server that the single gNMIc instance will use to aggregate the collected data.

The aggregation gNMIc instance exposes a Prometheus output that is registered in Consul and is discoverable by the Prometheus server.

The whole lab is pretty much self organising:

  • The gNMIc cluster instances discover the targets dynamically using a Docker Loader
  • The gNMIc standalone instance, discovers the cluster instance using a Consul Loader
  • The Prometheus server discovers gNMIc's Prometheus output using Consul Service Discovery

Deployment files:

Deploy it with:

git clone https://github.com/openconfig/gnmic.git
cd gnmic/examples/deployments/2.clusters/4.gnmi-server/containerlab
sudo clab deploy -t gnmi-server.clab.yaml

+----+-------------------------+--------------+------------------------------+-------+-------+---------+-----------------+-----------------------+
| #  |          Name           | Container ID |            Image             | Kind  | Group |  State  |  IPv4 Address   |     IPv6 Address      |
+----+-------------------------+--------------+------------------------------+-------+-------+---------+-----------------+-----------------------+
|  1 | clab-lab24-agg-gnmic    | 2e9cc2821b07 | ghcr.io/openconfig/gnmic:latest | linux |       | running | 172.20.20.7/24  | 2001:172:20:20::7/64  |
|  2 | clab-lab24-consul-agent | c17d31d5f41b | consul:latest                | linux |       | running | 172.20.20.2/24  | 2001:172:20:20::2/64  |
|  3 | clab-lab24-gnmic1       | 3d56e09955f2 | ghcr.io/openconfig/gnmic:latest | linux |       | running | 172.20.20.4/24  | 2001:172:20:20::4/64  |
|  4 | clab-lab24-gnmic2       | eba24dacea36 | ghcr.io/openconfig/gnmic:latest | linux |       | running | 172.20.20.3/24  | 2001:172:20:20::3/64  |
|  5 | clab-lab24-gnmic3       | caf473f500f6 | ghcr.io/openconfig/gnmic:latest | linux |       | running | 172.20.20.6/24  | 2001:172:20:20::6/64  |
|  6 | clab-lab24-grafana      | eaa224e62243 | grafana/grafana:latest       | linux |       | running | 172.20.20.8/24  | 2001:172:20:20::8/64  |
|  7 | clab-lab24-leaf1        | 6771dc8d3786 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.10/24 | 2001:172:20:20::a/64  |
|  8 | clab-lab24-leaf2        | 5cfb1cf68958 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.14/24 | 2001:172:20:20::e/64  |
|  9 | clab-lab24-leaf3        | c438f734e44d | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.19/24 | 2001:172:20:20::13/64 |
| 10 | clab-lab24-leaf4        | ae4321825a03 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.17/24 | 2001:172:20:20::11/64 |
| 11 | clab-lab24-leaf5        | ee7a520fd844 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.18/24 | 2001:172:20:20::12/64 |
| 12 | clab-lab24-leaf6        | 59c3c515ef35 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.9/24  | 2001:172:20:20::9/64  |
| 13 | clab-lab24-leaf7        | 111f858b19fd | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.22/24 | 2001:172:20:20::16/64 |
| 14 | clab-lab24-leaf8        | 0ecc69891eb4 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.20/24 | 2001:172:20:20::14/64 |
| 15 | clab-lab24-prometheus   | 357821ec726e | prom/prometheus:latest       | linux |       | running | 172.20.20.5/24  | 2001:172:20:20::5/64  |
| 16 | clab-lab24-spine1       | 0f5f6f6dc5fa | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.13/24 | 2001:172:20:20::d/64  |
| 17 | clab-lab24-spine2       | b718503d3b3f | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.15/24 | 2001:172:20:20::f/64  |
| 18 | clab-lab24-spine3       | e02f18d0e3ff | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.11/24 | 2001:172:20:20::b/64  |
| 19 | clab-lab24-spine4       | 3347cba3f277 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.12/24 | 2001:172:20:20::c/64  |
| 20 | clab-lab24-super-spine1 | 4abc7bcaf43c | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.16/24 | 2001:172:20:20::10/64 |
| 21 | clab-lab24-super-spine2 | 5b2f5f153d43 | ghcr.io/nokia/srlinux        | srl   |       | running | 172.20.20.21/24 | 2001:172:20:20::15/64 |
+----+-------------------------+--------------+------------------------------+-------+-------+---------+-----------------+-----------------------+
Check the Prometheus Output and gNMI Server documentation pages for more configuration options