Giter VIP home page Giter VIP logo

srl-k8s-anycast-lab's Introduction

Nokia SR Linux Kubernetes Anycast Lab

In this lab we will explore a topology consisting of a Leaf/Spine SR Linux Fabric connected to a Kubernetes Cluster.

Our k8s Cluster will feature MetalLB, which is a load-balancer implementation for bare metal clusters. This will unlock the possibility to have anycast services in our fabric.

To deploy this lab we will use Containerlab which help us to effortlessly create complex network topologies and validate features, scenarios... And also, Minikube which is an open-source tool that facilitates running Kubernetes clusters locally to quickly test and experiment with containerized applications.

The end service we will use on top of the kubernetes cluster is a Nginx HTTP echo server. This service will be deployed and exposed in all the k8s nodes. With simulated clients, we will verify how traffic is distributed among the different nodes/pods.

For a detailed walkthrough of this lab please check the SR Linux blog.

Topology

Goal

Demonstrate kubernetes MetalLB load balancing scenario in a Containerlab+Minikube Lab.

Features

  • Containerlab topology
  • Minikube kubernetes cluster (3 nodes)
  • MetalLB integration (FRR mode)
  • Preconfigured Leaf/Spine Fabric: 2xSpine, 4xLeaf SR Linux switches
  • Anycast services
  • Linux clients to simulate connections to k8s services (4 clients)

Requirements

Deploying the lab

# clone this repository
git clone https://github.com/srl-labs/srl-k8s-anycast-lab && cd srl-k8s-anycast-lab
# deploy minikube cluster
minikube start --nodes 3 -p cluster1
# deploy containerlab topology
clab deploy --topo srl-k8s-lab.clab.yml
# enable MetalLB addons
minikube addons enable metallb -p cluster1
# install MetalLB (BGP FRR mode)
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/main/config/manifests/metallb-frr.yaml
# setup MetalLB
kubectl apply -f metallb.yaml
# Add k8s HTTP echo deployment and LB service
kubectl apply -f nginx.yaml

Tests

# check underlay sessions in Spine, leaf switches
A:spine1$ show network-instance default protocols bgp neighbor

# check MetalLB BGP sessions in Leaf switches
A:leaf2$ show network-instance ip-vrf-1 protocols bgp neighbor

# check kubernetes status
kubectl get nodes -o wide

kubectl get pods -o wide

kubectl get svc

# check MetalLB BGP speaker pods in kubernetes nodes
kubectl get pods -A | grep speaker

# connect to MetalLB speaker pod
# change speaker-4gcj8 with the name of one of the speakers
kubectl exec -it speaker-4gcj8 --namespace=metallb-system -- vtysh

# verify BGP sessions in FRR daemon
cluster1$ show bgp summary

# verify running config of FRR daemon
cluster1$ show run

# check HTTP echo service
docker exec -it client4 curl 1.1.1.100
Server address: 10.244.0.3:80
Server name: nginxhello-6b97fd8857-4vp6z
Date: 10/Aug/2023:09:06:01 +0000
URI: /
Request ID: f84edead22027f72b2dc951fbfe96b4f

# check HTTP echo service once again
docker exec -it client4 curl 1.1.1.100
Server address: 10.244.2.3:80
Server name: nginxhello-6b97fd8857-b2vf8
Date: 10/Aug/2023:09:06:03 +0000
URI: /
Request ID: f03d053c39bd725519e86fa5b588f7f6

# requests are load balanced to different pods

Delete the lab

# destroy clab topology and cleanup 
clab destroy --topo srl-k8s-lab.clab.yml --cleanup
# delete Minikube cluster
minikube delete --all

srl-k8s-anycast-lab's People

Contributors

hellt avatar michelredondo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.