How to get ip range from aws kubernetes cluster and add it to my database cluster whitelist

1/12/2018

I have a database cluster that needs to set IP range into the whitelist. I set up a kubernetes cluster and run my app. How can I give/get the kubernetes cluster an IP address so that I can set it to my whitelist?

Thank you~

-- TimLee
amazon-vpc
amazon-web-services
kubernetes

2 Answers

1/12/2018
  • Check your VPC's CIDR
  • Go to the Inbound rules of your database's security group
  • Allow all inbound traffic on port 3306 from the above CIDR

Hopefully this allow everything in your kubernetes cluster to reach your database.

There are of course more fine-grained and complex solution for security policies (e.g. allow only specific pods to reach your db) but that is most likely another story / question.

-- pkaramol
Source: StackOverflow

1/12/2018

If you can SSH into the cluster, you can run "ip addr show" to get the ip address.

-- Brandon Schabell
Source: StackOverflow