Hello !
We have encountered a problem, and we are seeking your knowlegde to resolve it !
The setup :
- Kubernetes Cluster, AWS EKS, v 1.15
- CoreDNS is deployed (by default)
- Kong, deployed inside this cluster, connecting to PostgreSQL
- PostgreSQL, deployed with AWS RDS
DNS resolution with CoreDNS is working fine
If we are using a short name, like postgresql, we are having this kind of error :
2020/05/18 15:47:09 [error] 22#0: *648 [kong] exporter.lua:161 prometheus: failed to reach database while processing/metrics endpoint: [cosocket] DNS resolution failed: dns server error: 3 name error. Tried: ["(short)postgresql:(na) - cache-miss","postgresql.watermarking.svc.cluster.local:5 - cache-hit/dns server error: 3 name error","postgresql.svc.cluster.local:5 - cache-hit/dns server error: 3 name error","postgresql.cluster.local:5 - cache-hit/dns server error: 3 name error","postgresql.e2e-vo-wmk.int.:5 - cache-hit/dns client error: 101 empty record received","postgresql.eu-west-1.compute.internal:5 - cache-hit/dns server error: 3 name error","postgresql:5 - cache-hit/dns server error: 3 name error","postgresql.watermarking.svc.cluster.local:33 - cache-hit/dns server error: 3 name error","postgresql.svc.cluster.local:33 - cache-hit/dns server error: 3 name error","postgresql.cluster.local:33 - cache-hit/dns server error: 3 name error","postgresql.e2e-vo-wmk.int.:33 - cache-hit/dns client error: 101 empty record received","postgresql.eu-west-1.compute.internal:33 - cache-hit/dns server error: 3 name error","postgresql:33 - cache-hit/dns server error: 3 name error","postgresql.watermarking.svc.cluster.local:1 - cache-hit/dns server error: 3 name error","postgresql.svc.cluster.local:1 - cache-hit/dns server error: 3 name error","postgresql.cluster.local:1 - cache-hit/dns server error: 3 name error","postgresql.e2e-vo-wmk.int.:1 - cache-hit/dns client error: 101 empty record received","postgresql.eu-west-1.compute.internal:1 - cache-hit/dns server error: 3 name error","postgresql:1 - cache-hit/dns server error: 3 name error"], client: 10.10.12.115, server: kong_prometheus_exporter, request: "GET /metrics HTTP/1.1", host: "10.10.11.187:9542"
If we are using a long name (FQDN), we don’t have any problem, and it’s working fine.
The thing : we want to use the short name, and since the DNS resolution is working fine, we shouldn’t have to do anything
Unless to set the DNS resolver to CoreDNS ? But it should be by default, no ?
Thank you for your time