Hi @Huynh, Huu Thang,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
As we understand that, you are experiencing an issue with connecting to a PostgreSQL database from a private AKS cluster. Based on the error message you provided, it seems like the hostname of the database is not being resolved to an IP address.
Regarding your issue, about nslookup returning a result missing the IP address of the database's private endpoint, this could be due to the DNS resolution is not configured correctly for the virtual network where the database is located. Another possibility is that there is a firewall rule blocking the traffic between the AKS cluster and the database.
To troubleshoot this issue, I would suggest the following steps:
- Check the DNS resolution settings for the virtual network where the database is located. Make sure that the DNS server is configured correctly, and that the DNS resolution is working as expected.
- Check the firewall rules for the virtual network where the database is located. Make sure that the firewall rules are not blocking the traffic between the AKS cluster and the database.
- Check the network security group (NSG) settings for the virtual network where the database is located. Make sure that the NSG is not blocking the traffic between the AKS cluster and the database.
- Check the connection string for the PostgreSQL database. Make sure that the hostname is correct and that the port number is specified correctly.
- Try connecting to the PostgreSQL database from a different location, such as a virtual machine in the same virtual network as the AKS cluster. This will help you determine if the issue is specific to the AKS cluster or if it is a more general networking issue.
Please refer to the below mentioned links for more information.
https://docs.azure.cn/en-us/postgresql/flexible-server/concepts-networking-private-link
I hope this information helps. Please do let us know if you have any further queries.
If the answer is helpful, please click "Accept Answer" and "Upvote it".