Oracle Cloud Edge Services
Oracle Cloud Infrastructure provides Edge Services, is a group of services related with DNS, Health Checks, Traffic Management and WAF (Web Application Firewall).
In this episode we are utilising DNS Zone Management, Traffic Management Steering Policies and Health Checks for load balancing and fail-over of a micro-service running in two different Kubernetes clusters, in two different regions and distinct cloud providers, giving a robust solution that accomplishes a very powerful load balanced, active-active and disaster recovery topology.
Deploying the micro-service
Deploy the following to two different k8s clusters, such as OKE in two distinct regions or OKE and GKE. As OKE and GKE are petty much identical, we can use kubectl and Kubernetes Dashboard in both of them as we prefer:
It is a very simple service that greets you and says where is it running.
For this part of the setup we need a FQDN registered, we are using bigdatasport.org, a name registered by myself.
Let’s create domain entries in OCI. Create a DNS zone in OCI as follows:
Now, let’s grab the DNS servers and go to our Registrar and change the DNS’s configuration so that they point to Oracle DNS’s:
Verify the change:
Configuring Health Checks
Let’s create a Health Check that we’ll use later in the traffic management. Health checks are performed external to OCI from a list of vantage points executed in Azure, Google or AWS, select your preferred choice.
Configuring Traffic Management Steering Policies
Let’s create a traffic management policy as follows:
Testing it all
Ok, we have all the tasks already done, let’s test it!
Delete the deployment in OKE:
Go to the Traffic policy and verify that the OKE endpoint is unhealthy:
Go to your browser and request http://bigdatasport.org/greet, as you can see the service is retrieved from GKE:
Redeploy in OKE again:
As you can see, the OKE service is running well again:
Now let’s delete the deployment in GKE:
Now the greeting is retrieved again form OKE:
And that’s all folks, hope it helps! 🙂