- Make sure all variables are set correct in the
makefile
- Install K3d
make setup
- This creates the k3d registry, builds/pushes the Consul/Consul-K8s images and sets the images in an environment filek8sImages.env
make install
- Deletes and creates four k3d Kubernetes clusters.
- Installs Consul on each of the four Kubernetes created in the previous step.
- Runs the static-client and static-server services on each Kubernetes cluster. static-server returns the peer name for the given partition.
- Synchronizes configuration entries to each member of the sameness group.
- Note: The logs may contain errors when installing
Error from server (NotFound): secrets "cluster-02-a-peering-token" not found
. This is normal, and is just a timing issue with tokens being created and not existing yet.
- If the image is having issues pushing to the K3d registry, make sure that registry is added to your host file
/etc/host
example content.127.0.0.1 k3d-registry.localhost
After runing the setup steps, the following tests making requests from static-client
in cluster-01-a
static-server
.
static-server
is configured to failover to sameness group members in the following order: cluster-01-a
, cluster-01-b
, cluster-02
and finally cluster-03
.
Run the following commands to verify this:
./make_request.sh
- Returnscluster-01-a
./scale.sh 1 0
to trigger a failover../make_request.sh
- Returnscluster-01-b
./scale.sh 2 0
to trigger a failover../make_request.sh
- Returnscluster-03
./scale.sh 4 0
to trigger a failover../make_request.sh
- Returnscluster-02