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
- Creating a Local Development Kubernetes Cluster with K3D and Traefik Proxy
- Rancher 2.4 & Kubernetes on your macOS laptop with Docker & k3d
- K8s on macOS with K3s, K3d and Rancher
- K3D Load Balancing — MetalLB on Mac
- K3D Exposing Services
- Introduction to k3d: Run K3s in Docker
- How to Create a Kubernetes Cluster and Load Balancer for Local Development