Closed roquie closed 4 years ago
I haven't used Kubernetes, yet. How does DNS resolution work there? What's different?
Sorry for long answer. On next week I will be again works with amphp/dns
and try to run series of tests in cluster. Before this bug I should fix the issue with amphp/postgres
because it blocks my work.
1.2.1
does not work in cluster with global available addresses (tested github.com
and api.telegram.org
), but 0.9.15
works fine. 0.9.15
also does not work with local domain names in kubernetes cluster1.1.0
works same as 0.9.15
In all cases gethostbyname
returns ip.
UPD:
For 1.2.1
version this hack not help me. https://github.com/amphp/dns/issues/82
/etc/resolv.conf
cat /etc/resolv.conf
nameserver 172.17.0.10
search calcifer-dev.svc.cluster.local svc.cluster.local cluster.local
options ndots:5
I'm trying to find some bugs in PR https://github.com/amphp/dns/pull/89 ...
What's the error message you get for github.com
?
Please retry with https://github.com/amphp/dns/commit/8cf2ccc4fa5a97f15b0b11087b22d2b544e45ab2 / latest dev-master
.
Yes, that works in all cases. Thanks! :)
Any requests called with
amphp/http-client
will use these dns package. Where requests will sent inside kubernetes cluster it fails with following reason:Requests from pod to pod inside a same namespace in Kubernetes cluster by service name (kubectl get svc). If using local ip address instead of dns it works. But this workaround is not possible for all cases.
I think this is critical issue because a lot of many users use Kubernetes every day.
PHP: 7.4.5 amphp/amp: v2.4.4 amphp/dns: v1.2.1 amphp/http-client: v4.2.2 OS: Alpine
UV extension installed from pecl.