This demo uses Linkerd's new multicluster functionality to demonstrate failover & traffic-splitting in a multi-cluster mesh of Kubernetes clusters.
k3d:v5
smallstep/cli
linkerd:stable-2.12.0
+- A devcontainer is included with the needed tools.
./create.sh
initializes a set of clusters in k3d
: dev,
east, and west.
./install.sh
creates a temporary CA and installs Linkerd
into these clusters.
We can then deploy the app into the east and west clusters:
:; kubectl --context=k3d-east apply -k east
:; kubectl --context=k3d-west apply -k west
These clusters operate independently by default.
./link.sh
configures linkerd-multicluster gateways & service
mirrors on each cluster. east and west are configured to discover
services from each other. dev is only configured run the web and
vote-bot components, and it discovers other services from both east and
west.
At this point, we can start our dev setup which uses the voting and emoji services in the east and west clusters:
:; kubectl --context=k3d-dev apply -k dev
We can also route traffic between the east and west clusters.
See the commented sections in
./east/kustomization.yml
and
./west/kustomization.yml
. These configurations
can be modified to reroute traffic between clusters!