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
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 things like IRSA(IAM Roles for Service Accounts)
Deploy k8gb §
values.yaml override configs can be found here
You can use
helm to deploy stable release from Helm repo
helm repo add k8gb https://www.k8gb.io
Alternatively, use make target to deploy right from the git repository
make deploy-gslb-operator VALUES_YAML=./docs/examples/route53/k8gb/k8gb-cluster-eu-west-1.yaml #switch kubectl context to us-east-1 make deploy-gslb-operator VALUES_YAML=./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 kubctl context and apply the same command to all clusters.
- Deploy test application to each cluster.
Modify sample Gslb CR to reflect your
Apply Gslb CR to each cluster
kubectl apply -f examples/route53/k8gb-failover.yaml
- Check Gslb status.
kubectl -n test-gslb get gslb test-gslb-failover -o yaml
- Check route53 entries.
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.
- Check test application availability.
curl -s failover.test.k8gb.io| grep message "message": "eu-west-1",
failover.test.k8gb.io with the domain you specified in Gslb spec.
Notice that traffic was routed to
- Emulate the failure in
kubectl -n test-gslb scale deploy frontend-podinfo --replicas=0
- Observe Gslb status change.
k -n test-gslb get gslb test-gslb-failover -o yaml | grep status -A6 status: geoTag: us-east-1 healthyRecords: failover.test.k8gb.io: - 184.108.40.206 serviceHealth: failover.test.k8gb.io: Healthy
IP in healthyRecords should change to the IP address of NLB in
- Check failover to
curl -s failover.test.k8gb.io| grep message "message": "us-east-1",
Notice that traffic is properly failed over to
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.