Deploy a CI/CD pipeline with DNS Failover (Active/Passive)

0

Hi AWS, I am building a CI/CD pipeline for Windows Service to run in Active Passive strategy as part of Disaster Recovery using GitHub Actions. Here is the URL for the GitHub Repo: https://github.com/arjungoel/WindowsServiceDemo

The simplest way I used to deploy is I have created a workflow (.yaml files) with a build job and two deploy jobs i.e. deploy-active and deploy-passive. But I need to make sure the service will be running only on one server aka runner at a time. Here is the URL for the workflow file: https://github.com/arjungoel/WindowsServiceDemo/blob/master/.github/workflows/windows-service-active-passive.yml

But now the issue is after the workflow is executed successfully the service gets deployed on both the servers (Active & Passive). Please help me how to fix this issue. Is there some intelligence which I need to add in my application code.

I guess this can be achieved using Route-53 active-passive config https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/dns-failover-types.html but I am not sure how to incorporate it in my pipeline.

Can someone from AWS community help me around with this?

1 Answer
1

To achieve an active-passive deployment strategy for your Windows service in a disaster recovery scenario using GitHub Actions, you can indeed leverage Route 53 DNS failover. Here's a high-level overview of the steps you can take:

Identify Active and Passive Instances: Ensure that you have two instances set up, one serving as the active instance and the other as the passive instance. These instances should be identical in terms of configuration and should both have the Windows service installed.

Modify GitHub Actions Workflow:

Update your GitHub Actions workflow to trigger only one of the deploy jobs based on some condition. For example, you could use a workflow dispatch event or a scheduled event to trigger the deployment. Add logic to your workflow to check if the current instance is the active instance. You can do this by querying an external service or by using environment variables or secrets in GitHub Actions. Only run the deployment steps if the current instance is the active instance. Integrate with Route 53 DNS Failover:

Set up a health check for your active instance using Route 53 health checks. Configure a DNS failover policy in Route 53 to route traffic to the active instance by default and fail over to the passive instance if the health check fails. Update the DNS records for your service to point to the Route 53 failover endpoint. Testing and Monitoring:

Test your setup to ensure that traffic is routed correctly to the active instance and fails over to the passive instance when needed. Set up monitoring and alerting to notify you if the health check fails or if there are any issues with the failover process. By following these steps, you can implement an active-passive deployment strategy for your Windows service using GitHub Actions and Route 53 DNS failover. This setup will help ensure high availability and disaster recovery for your service. If you need further assistance with specific implementation details or troubleshooting, feel free to ask!

profile picture
EXPERT
answered a month ago
  • Do you have any working example for the same just to get a better understanding?

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions