Allow AWS RDS connection from an Azure K8S pods

5/22/2019

We are currently migrating from AWS ECS to Azure Kubernetes Service. Our first step is to first migrate the application code and just leave the database in AWS RDS, for now. Our RDS instance is protected by a security group which only allows connection from a set of IP addresses.

When connecting to the RDS instance, what IP address does the database see? How can I configure RDS to allow connection from a kubernetes pod?

-- Gino Corpuz
azure
devops
kubernetes
networking
rds

1 Answer

5/22/2019

If you have an Azure Load Balancer (so any kubernetes service with type LoadBalancer) attached to worker nodes - they will use the first IP attached to the Load Balancer. If not - they will use public IP attached to the VM they run on. If the VM doesnt have a public IP (default for AKS), they will use ethereal IP that might change anytime and you have no control over that.

So just create a service with the type of LoadBalancer in AKS, find its external IP address and whitelist that.

-- 4c74356b41
Source: StackOverflow