Demo for the talk "Evaluating Global Load Balancing Options for Kubernetes in Practice" presented at ContainerDays 2025 in Hamburg by Nicolai Ort and Tobias Schneck. Slides are shared on Google Docs: https://docs.google.com/presentation/d/10l3WNjHVwei7WuuTQrpcSLnK3m5OZ0XGGzghR7P0GDM/edit?usp=sharing
This is an updated version of the talk we presented at Cloud Native Rejekts 2025 in London. You can find the repo for that talk here: https://github.com/nicolaiort/rejekts2025-gslb
- Updated to k8gb v0.15.0
- Updated cert-manager to v1.18.2
- Added DNSSEC support for k8gb demo -> Pretty cool, right? :)
This repository contains two main demos:
- k8gb: A demo of the k8gb global load balancer
- Round Robin based load balancing across multiple clusters
- Failover based load balancing across multiple clusters with one primary cluster and multiple secondary clusters
- DNSSEC support
- clustermesh: A demo of clustermesh based load balancing implemented with cilium
We also included the drawings we used in the talk to explain the concepts of global load balancing in the images directory. The .excalidraw.svg files are editable with Excalidraw.
Please note that this repo contains secrets encrypted with git-crypt, they are only used for the live-demo and are not needed to run the demo yourself. You can just override the secrets with your own values.
- Three Kubernetes clusters (we used clusters managed by KKP) with:
- LoadBalancers that are reachable from each other and your local machine
- LoadBalancers must support UDP (yes, some cloud providers don't support UDP for LoadBalancers)
- A public domain name hosted on a DNS provider that supports external-dns (we used Cloudflare)
- Kubectl installed on your local machine
- Helm installed on your local machine
- Make installed on your local machine
-
Clone this repository:
git clone git@github.com:nicolaiort/containderdays2025-gslb.git #via SSH # or git clone https://github.com/nicolaiort/containderdays2025-gslb.git #via HTTPS
-
Change into the directory:
cd containderdays2025-gslb
-
Switch to the
k8gbdirectory:cd k8gb -
Get your kubeconfigs for the clusters you want to use and place them in the
.secretsdirectory. The files should be namedcluster1,cluster2, etc. -
Create secrets, create namespaces and install nginx with cert-manager into your clusters:
make setup
-
Setup k8gb in your clusters:
make k8gb-setup
-
Set your demo service to round-robin:
make k8gb-roundrobin
-
Observe the responses of the demo service:
make repeat TIMES=10 COMMAND="make curl-resolved DOMAIN=demo.k8gb.nig.gl" # or to just get the counts make dig-chart TIMES=100 DOMAIN="demo.k8gb.nig.gl"
It should round-robin between the clusters.
-
Take down one of the clusters:
make stop-service CLUSTERID=1
-
Observe the responses of the demo service:
make repeat TIMES=10 COMMAND="make curl-resolved DOMAIN=demo.k8gb.nig.gl"It should round-robin between the clusters excluding the one we took down.
-
Bring the cluster back up:
make start-service CLUSTERID=1
-
Observe the responses of the demo service:
make repeat TIMES=10 COMMAND="make curl-resolved DOMAIN=demo.k8gb.nig.gl"It should round-robin between all clusters again.
-
Set your demo service to failover:
make k8gb-failover
-
Observe the responses of the demo service:
make repeat TIMES=10 COMMAND="make curl-resolved DOMAIN=demo.k8gb.nig.gl"It should always respond from the primary cluster.
-
Take down the primary cluster:
make stop-service CLUSTERID=1
-
Observe the responses of the demo service:
make repeat TIMES=10 COMMAND="make curl-resolved DOMAIN=demo.k8gb.nig.gl"It should now round-robin between the remaining clusters.
-
Bring the cluster back up:
make start-service CLUSTERID=1
-
Observe the responses of the demo service:
make repeat TIMES=10 COMMAND="make curl-resolved DOMAIN=demo.k8gb.nig.gl"It should always respond from the primary cluster.