How to resolve Kubernetes DNS troubles with Amazon RDS hosts

0 votes

I have an Flask + SQLAlchemy deployed in Kubernetes, using Amazon AWS as cloud provider (Amazon EC2 machines) with a PostgreSQL RDS.

Sometimes an excetion arises when a request is performed:

psycopg2.OperationalError: could not translate host name "xxx.yyy.eu-west-1.rds.amazonaws.com" to address: Name or service not known

The Amazon RDS instance is located at the same VPC that the Kubernetes cluster, so DNS resolutions must turn into internal IP within the VPC.

I've tried to use Kubernetes kube-dns built-in stubDomains forcing to resolve *.rds.amazonaws.comDNS requests through VPC DNS resolver (in my case 10.0.0.2) but the exception keeps arising.

Does anybody have an idea of what's going wrong?

Thanks in advance.

Sep 25, 2018 in AWS by bug_seeker
• 15,510 points
2,156 views

1 answer to this question.

0 votes

I have seen that on our flannel backed cluster when the machines are under high CPU load. Also, as a for your consideration, I have never had to alter the kube-dns settings, since it will resolve .cluster.localnames, and then delegate to the EC2 resolv.conf as expected. Have you tried altering the Pod's 

answered Sep 25, 2018 by Priyaj
• 58,020 points

Related Questions In AWS

0 votes
1 answer

How to create analysis with Amazon Quicksight?

The entire process is fairly simple.  Amazon QuickSight ...READ MORE

answered Nov 14, 2018 in AWS by Archana
• 5,640 points
1,203 views
0 votes
1 answer
+1 vote
1 answer
0 votes
1 answer
+1 vote
2 answers
+2 votes
1 answer

How to Use Amazon AWS Credentials to Access/Query Tables in AWS RDS Instance through Mobile App

You should make your backend functions to ...READ MORE

answered Aug 28, 2018 in AWS by Priyaj
• 58,020 points
1,259 views
0 votes
1 answer

How to copy .csv file from Amazon S3 bucket?

Boto3 is the library to use for ...READ MORE

answered Jul 6, 2018 in AWS by Priyaj
• 58,020 points
2,097 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP