How to create Trafik V2 load balancer on a K3D kubernetes cluster as a local development environment.

TL;DR

Step 1: create the K3D cluster local-k8s

Step 2: deploy the Traefik Load Balancer

helm upgrade -i traefik traefik --version 21.0.0 --repo https://helm.traefik.io/traefik -f traefik.v2.values.yaml
Inputs

Step 3: validate the load balancing by exposing the dashboard of Traefik itself

kubectl apply -f traefik-dashboard.ingress-route.yaml
Inputs

Step 4: validate the load balancing by creating the whoami application stack

kubectl create deploy whoami --image containous/whoami
kubectl expose deploy whoami --port 80
kubectl apply -f whoami.ingress-route.yaml
Inputs

Teardown

delete the K3D cluster

k3d cluster delete ${local_k8s}

References