A lab code to test Kubernetes integration with SRv6 / VRF
- kubernetes 1.31
- VMs: Ubuntu 24.04, one NIC
- vrf kernel module
kubectl apply -f https://raw.githubusercontent.com/svinota/pyroute2-cni/refs/heads/main/kubernetes/pyroute2-cni.yaml
see also config['plan9']['port']
any node can be used, all the info is replicated
Warning
No recovery is pushed in the repo at the moment!
9p -a {node_ip}:8149 read allocated # → allocated addresses
9p -a {node_ip}:8149 read graph | display # → topology map as SVG
Warning
Please notice that at the lab stage configuration options format may change daily.
Namespace labels
apiVersion: v1
kind: Namespace
metadata:
labels:
kubernetes.io/metadata.name: test
pyroute2.org/prefix: "10.1.0.0"
pyroute2.org/prefixlen: "16"
pyroute2.org/vrf: "1000"
pyroute2.org/vxlan: "200"
name: test
- prefix: the prefix to use in the namespace
- prefixlen: the network mask bits
- vrf: the VRF to use for the namespace; see also
End.DT4 vrftable; → creates interfacevrf-{int}in the host netns - vxlan: VXLAN id of the transport between nodes;
→ creates interface
vxlan-{int}in the host netns
Pod labels
To be delivered soon
ConfigMap
apiVersion: v1
kind: ConfigMap
metadata:
name: server-config
namespace: pyroute2-cni
data:
server.ini: |
[api]
socket_path_api = /var/run/pyroute2/api
socket_path_fd = /var/run/pyroute2/fdpass
[network]
host_if = enp1s0
[default]
prefix = 10.244.0.0
prefixlen = 16
vxlan = 42
vrf = 42
[plan9]
port = 8149
[mdns]
service = _9p2r._tcp.local.