How to connect GKE to an AWS RDS instance?

1/8/2018

What's the best/easier way to connect an AWS RDS instance to my kubernetes cluster running on gcloud?

-- Steven Barragán
amazon-rds
google-kubernetes-engine
kubernetes

2 Answers

3/14/2018

One thing you can do is: Add a label for some of your nodes with kubectl label nodes in order to have control over their public IP addresses, they are ephemeral so I think you will want to reserve a static IP for those nodes you choose.

Each virtual machine is named with its corresponding node's name, so you can use the same name you used in the previous kubectl label nodes command.

Now all you have to do is, add each IP to the security group that corresponds to your RDS instance.

-- George Coffey
Source: StackOverflow

2/12/2018

Likely the only way there is, is using their public availability option upon creating the instance. That really is just fine. You will get a DNS hostname that also powers their loadbalancing feature.

Note, their are similar question for connection within AWS, which report DNS problems, that do not apply in your case Ref: Accessing Postgres RDS from Kubernetes cluster in AWS

-- eljefedelrodeodeljefe
Source: StackOverflow