Inventory#
In this exercise, we will focus on inventory and identifiers for network automation, commonly referred to as a source of truth. The goal is to demonstrate how we can leverage the extendability and flexibility of Kubernetes, which allows customization of the API and the development of applications that utilize this API to build various constructs for different use cases.
Before configuring devices with IP, VLAN, BGP, and EVPN constructs, it is crucial to understand the topology these devices utilize. In this exercise, we have chosen to import the inventory used in the containerlab setup. This approach highlights how discovery and provisioning methods can be leveraged and interworked together.
First, we create the device models for the srlinux devices used in our environment. This exercise demonstrates how to use a device profile for a specific role in the network and the corresponding device configuration. Different profiles can be applied for various network roles, with this configuration serving as the source of truth. It also shows how to handle a multi-vendor environment and customize configurations for different vendors and roles in the deployment.
This capability is enabled using kuidapps, such as the Nokia-specific kuid app in this case. However, a specific vendor app can be installed for other vendors. In this exercise, we opted for a specific srlinux API (srl.nokia.app.kuid.dev/v1alpha1), but a vendor-agnostic API could also be used.
We used this approach because containerlab will only connect and configure the interfaces used in the lab, but the automation might want to use other interfaces the device supports. You could also add specific information to each interface e.g. whether this interface is used for client/customer connectivity, etc
Specific vendor device model
apiVersion: srl.nokia.app.kuid.dev/v1alpha1
kind: NodeModel
metadata:
name: ixrd2.srlinux.nokia.com
namespace: default
spec:
provider: srlinux.nokia.com
interfaces:
- name: "e1-1"
speed: "25G"
- name: "e1-2"
speed: "25G"
- name: "e1-3"
speed: "25G"
- name: "e1-4"
speed: "25G"
- name: "e1-5"
speed: "25G"
- name: "e1-6"
speed: "25G"
- name: "e1-7"
speed: "25G"
- name: "e1-8"
speed: "25G"
- name: "e1-9"
speed: "25G"
- name: "e1-10"
speed: "25G"
- name: "e1-11"
speed: "25G"
- name: "e1-12"
speed: "25G"
- name: "e1-13"
speed: "25G"
- name: "e1-14"
speed: "25G"
- name: "e1-15"
speed: "25G"
- name: "e1-16"
speed: "25G"
- name: "e1-17"
speed: "25G"
- name: "e1-18"
speed: "25G"
- name: "e1-19"
speed: "25G"
- name: "e1-20"
speed: "25G"
- name: "e1-21"
speed: "25G"
- name: "e1-22"
speed: "25G"
- name: "e1-23"
speed: "25G"
- name: "e1-24"
speed: "25G"
- name: "e1-25"
speed: "25G"
- name: "e1-26"
speed: "25G"
- name: "e1-27"
speed: "25G"
- name: "e1-28"
speed: "25G"
- name: "e1-29"
speed: "25G"
- name: "e1-30"
speed: "25G"
- name: "e1-31"
speed: "25G"
- name: "e1-32"
speed: "25G"
- name: "e1-33"
speed: "25G"
- name: "e1-34"
speed: "25G"
- name: "e1-35"
speed: "25G"
- name: "e1-36"
speed: "25G"
- name: "e1-37"
speed: "25G"
- name: "e1-38"
speed: "25G"
- name: "e1-39"
speed: "25G"
- name: "e1-40"
speed: "25G"
- name: "e1-41"
speed: "25G"
- name: "e1-42"
speed: "25G"
- name: "e1-43"
speed: "25G"
- name: "e1-44"
speed: "25G"
- name: "e1-45"
speed: "25G"
- name: "e1-46"
speed: "25G"
- name: "e1-47"
speed: "25G"
- name: "e1-48"
speed: "25G"
- name: "e1-49"
speed: "100G"
- name: "e1-50"
speed: "100G"
- name: "e1-51"
speed: "100G"
- name: "e1-52"
speed: "100G"
- name: "e1-53"
speed: "100G"
- name: "e1-54"
speed: "100G"
- name: "e1-55"
speed: "100G"
- name: "e1-56"
speed: "100G"
apiVersion: srl.nokia.app.kuid.dev/v1alpha1
kind: NodeModel
metadata:
name: ixrd3.srlinux.nokia.com
namespace: default
spec:
provider: srlinux.nokia.com
interfaces:
- name: "e1-1"
speed: "10G"
- name: "e1-2"
speed: "10G"
- name: "e1-3"
speed: "100G"
- name: "e1-4"
speed: "100G"
- name: "e1-5"
speed: "100G"
- name: "e1-6"
speed: "100G"
- name: "e1-7"
speed: "100G"
- name: "e1-8"
speed: "100G"
- name: "e1-9"
speed: "100G"
- name: "e1-10"
speed: "100G"
- name: "e1-11"
speed: "100G"
- name: "e1-12"
speed: "100G"
- name: "e1-13"
speed: "100G"
- name: "e1-14"
speed: "100G"
- name: "e1-15"
speed: "100G"
- name: "e1-16"
speed: "100G"
- name: "e1-17"
speed: "100G"
- name: "e1-18"
speed: "100G"
- name: "e1-19"
speed: "100G"
- name: "e1-20"
speed: "100G"
- name: "e1-21"
speed: "100G"
- name: "e1-22"
speed: "100G"
- name: "e1-23"
speed: "100G"
- name: "e1-24"
speed: "100G"
- name: "e1-25"
speed: "100G"
- name: "e1-26"
speed: "100G"
- name: "e1-27"
speed: "100G"
- name: "e1-28"
speed: "100G"
- name: "e1-29"
speed: "100G"
- name: "e1-30"
speed: "100G"
- name: "e1-31"
speed: "100G"
- name: "e1-32"
speed: "100G"
- name: "e1-33"
speed: "100G"
- name: "e1-34"
speed: "100G"
Afterwards you import the containerlab topology, which is used to populate the inventory in kuid.
Topology
apiVersion: topo.app.kuid.dev/v1alpha1
kind: Topology
metadata:
name: topo3nodesrl
spec:
region: region1
site: site1
containerLab: |-
name: topo3nodesrl
mgmt:
mtu: 1500
#network: kind
network: kubenet
ipv4-subnet: 172.21.0.0/16
topology:
kinds:
nokia_srlinux:
image: ghcr.io/nokia/srlinux
linux:
image: ghcr.io/hellt/network-multitool
nodes:
edge01:
kind: nokia_srlinux
type: ixrd2
labels:
network.infra.be.kuid.dev/device-type: edge ## can also be pe
edge02:
kind: nokia_srlinux
type: ixrd2
labels:
network.infra.be.kuid.dev/device-type: edge ## can also be pe
core01:
kind: nokia_srlinux
type: ixrd3
labels:
network.infra.be.kuid.dev/device-type: core ## can also be p
client1:
kind: linux
labels:
infra.be.kuid.dev/exclude: "true"
client2:
kind: linux
labels:
infra.be.kuid.dev/exclude: "true"
links:
- endpoints: ["edge01:e1-49", "core01:e1-1"]
labels:
infra.be.kuid.dev/link-type: infra
- endpoints: ["edge02:e1-49", "core01:e1-2"]
labels:
infra.be.kuid.dev/link-type: infra
- endpoints: ["client1:eth1", "edge01:e1-1"]
labels:
infra.be.kuid.dev/exclude: "true"
- endpoints: ["client2:eth1", "edge02:e1-1"]
labels:
infra.be.kuid.dev/exclude: "true"
Execute the following command
Configue the topology inventory
===============================
# apply the nodemodel configuration for ixrd2 srlinux device [1/3]:
> kubectl apply -f https://raw.githubusercontent.com/kubenet-dev/kubenet/v0.0.1/inventory/srl/ixrd2.yaml
nodemodel.srl.nokia.app.kuid.dev/ixrd2.srlinux.nokia.com created
# apply the nodemodel configuration for ixrd3 srlinux device [2/3]:
> kubectl apply -f https://raw.githubusercontent.com/kubenet-dev/kubenet/v0.0.1/inventory/srl/ixrd3.yaml
nodemodel.srl.nokia.app.kuid.dev/ixrd3.srlinux.nokia.com created
# import the containerlab topology in kubernetes [3/3]:
> kubectl apply -f https://raw.githubusercontent.com/kubenet-dev/kubenet/v0.0.1/topo/3node-topology.yaml
topology.topo.app.kuid.dev/topo3nodesrl created
Lets check the inventory in kuid.
We first see that the 3 nodes are populated in the inventory system
NAME READY REGION SITE TOPOLOGY PROVIDER
topo3nodesrl.region1.site1.core01 True region1 site1 topo3nodesrl srlinux.nokia.com
topo3nodesrl.region1.site1.edge01 True region1 site1 topo3nodesrl srlinux.nokia.com
topo3nodesrl.region1.site1.edge02 True region1 site1 topo3nodesrl srlinux.nokia.com
We can also check the links.
NAME READY EPA EPB
topo3nodesrl.region1.site1.edge01.e1-49.topo3nodesrl.region1.site1.core01.e1-1 True topo3nodesrl.region1.site1.edge01.e1-49 topo3nodesrl.region1.site1.core01.e1-1
topo3nodesrl.region1.site1.edge02.e1-49.topo3nodesrl.region1.site1.core01.e1-2 True topo3nodesrl.region1.site1.edge02.e1-49 topo3nodesrl.region1.site1.core01.e1-2
And Lastly the endpoints
Dont mind the False ready condition in the endpoint. No k8s controller is acting on this and hence the status is False
NAME READY TOPOLOGY REGION SITE NODE
topo3nodesrl.region1.site1.core01.e1-1 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-10 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-11 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-12 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-13 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-14 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-15 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-16 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-17 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-18 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-19 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-2 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-20 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-21 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-22 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-23 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-24 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-25 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-26 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-27 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-28 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-29 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-3 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-30 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-31 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-32 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-33 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-34 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-4 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-5 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-6 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-7 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-8 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.core01.e1-9 False topo3nodesrl region1 site1 core01
topo3nodesrl.region1.site1.edge01.e1-1 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-10 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-11 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-12 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-13 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-14 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-15 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-16 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-17 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-18 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-19 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-2 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-20 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-21 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-22 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-23 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-24 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-25 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-26 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-27 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-28 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-29 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-3 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-30 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-31 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-32 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-33 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-34 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-35 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-36 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-37 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-38 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-39 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-4 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-40 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-41 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-42 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-43 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-44 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-45 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-46 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-47 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-48 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-49 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-5 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-50 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-51 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-52 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-53 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-54 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-55 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-56 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-6 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-7 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-8 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge01.e1-9 False topo3nodesrl region1 site1 edge01
topo3nodesrl.region1.site1.edge02.e1-1 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-10 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-11 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-12 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-13 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-14 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-15 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-16 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-17 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-18 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-19 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-2 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-20 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-21 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-22 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-23 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-24 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-25 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-26 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-27 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-28 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-29 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-3 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-30 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-31 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-32 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-33 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-34 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-35 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-36 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-37 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-38 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-39 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-4 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-40 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-41 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-42 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-43 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-44 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-45 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-46 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-47 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-48 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-49 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-5 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-50 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-51 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-52 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-53 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-54 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-55 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-56 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-6 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-7 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-8 False topo3nodesrl region1 site1 edge02
topo3nodesrl.region1.site1.edge02.e1-9 False topo3nodesrl region1 site1 edge02
We now have a full device and link inventory in the system, which we can use to build network constructs.