Could not connect to yb-tserver-service with external-ip using python application

I followed the instructions from the link below to deploy yugabyteDB on Amazon EKS

After deployment, I was able to do the followings

  1. Accessing the yb-master Admin UI
  2. Connecting and using the YSQL shell (I created a database, connected to it, created a table and inserted several records. I could view the changes in the yb-master Admin UI)

Then, I tried the sample of Python application provided in the link below but connection error occured.

Error message: psycopg2.OperationalError: could not translate host name “***” to address: Unknown host
I changed host value into the external-ip of one of the yb-tserver-service.

Could anyone please assist me regarding this issue?
Thank you in advance

@cyberboy : Can you clarify if ysqlsh -h <loadbalancer ip of yb-tserver-service works correctly? Are you using the same ip/hostname with ysqlsh and psycopg2?

@sanketh Thank you for your reply.

I connected to YSQL shell by using the command below
kubectl exec -n yb-demo-us-east-1a -it yb-tserver-0 – ysqlsh -h yb-tserver-0.yb-tservers.yb-demo-us-east-1a
Refer to “5. Connect using YugabyteDB shells” in the link below

As for the external-ip, I used the command below and picked the external-ip of one of the yb-tserver-service
kubectl get services --all-namespaces


See step 6 Deploy on Amazon Elastic Kubernetes Service (EKS) using Helm Chart | YugabyteDB Docs

Try to connect to the load balancer external ip and see if that works.

@cyberboy This seems like a connectivity issue in your AWS cluster if you cannot connect to the loadbalancer ip.

Thank you for your reply
I finally found out that the problem occurred because I was behind the proxy