This is a companion repo to the Connect Services in Different Consul Clusters with Cluster Peering tutorial, containing sample configuration to:
- Deploy two Kubernetes clusters with Consul
- Deploy HashiCups frontend in the first Kubernetes cluster
- Deploy HashiCups backend in the second Kubernetes cluster
- Configure Consul cluster peering between the two clusters
- Export the HashiCups
products-apiservice in the second datacenter - Connect the HashiCups frontend and backend via the cluster peering
- Verify peered Consul services
- Destroy environment
This repository has borrowed code from the following other repositories. Thank you!
- https://github.com/vanphan24/cluster-peering-demo
- https://github.com/hashicorp/learn-terraform-provision-aks-cluster
Create a Kubernetes cluster in Docker Desktop.
kubectl config view --minify --flatten > docker-desktop/dc1/edge/kubeconfig_edgeterraform -chdir=docker-desktop/dc1 apply -auto-approve terraform -chdir=docker-desktop/dc1 destroy -auto-approvekubectl get pods --all-namespaceskubectl get events --all-namespaces --sort-by='.metadata.creationTimestamp'