AWS based deployment with Route53 integration

Here we provide an example of k8gb deployment in AWS context with Route53 as edgeDNS provider.

Reference Setup

Two EKS clusters in eu-west-1 and us-east-1.

Terraform code for cluster reference setup can be found here

Feel free to reuse this code fully or partially and adapt for your existing scenario custom configuration like

Install Ingress Controller

kubectl apply -f

Deploy k8gb

Example helm configuration files can be found here

Modify them to reflect your dnsZone, edgeDNSZone, valid hostedZoneID and irsaRole ARN.

Clone k8gb repository and use helm with custom values

git clone
cd k8gb

helm repo add k8gb
helm repo update

#switch kubectl context to eu-west-1
helm -n k8gb upgrade -i k8gb k8gb/k8gb --create-namespace -f ./docs/examples/route53/k8gb/k8gb-cluster-eu-west-1.yaml

#switch kubectl context to us-east-1
helm -n k8gb upgrade -i k8gb k8gb/k8gb --create-namespace -f ./docs/examples/route53/k8gb/k8gb-cluster-us-east-1.yaml


Note: here and for all occurrences below whenever we speak about application to each cluster, we assume that you switch kubectl context and apply the same command to all clusters.

make deploy-test-apps
kubectl apply -f ./docs/examples/route53/k8gb/gslb-failover.yaml
kubectl -n test-gslb get gslb test-gslb-failover -o yaml
aws route53 list-resource-record-sets --hosted-zone-id $YOUR_HOSTED_ZONE_ID

You should see that gslb-ns-$dnsZone-$geotag NS and glue A records were created to automatically configure DNS zone delegation.

curl -s| grep message
  "message": "eu-west-1",

Replace with the domain you specified in Gslb spec.

Notice that traffic was routed to eu-west-1.

kubectl -n test-gslb scale deploy frontend-podinfo --replicas=0
kubectl -n test-gslb get gslb test-gslb-failover -o yaml | grep status -A6
  geoTag: us-east-1
  serviceHealth: Healthy

IP in healthyRecords should change to the IP address of NLB in us-east-1

curl -s| grep message
  "message": "us-east-1",

Notice that traffic is properly failed over to us-east-1

Now you can scale eu-west-1 back and observe that traffic is routed back to the primary cluster.

In addition, you can test roundRobin load balancing strategy, which is spreading the traffic over the clusters in active-active mode.