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:
Once you are allowed, install and configure “Incoming Webhooks”, selecting the slack channel you want the notifications to be sent to, name icon, attachments and the like. Finally, grab the Webhook URL for later.
DevCS Side Configuration
Go to DecCS, select a project and go to Administration/Webhooks
Create a new Webhook. Put in the field URL the url created in the slack configuration side and subscribe to the kind notifications you are interested in and clink on [Save]:
Click on [Test] button and verify a test message reaches the slack channel:
Now launch a build, create/edit an announcement or do whatever task that generates notifications and verify the notification reaches the channel: