Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.when run in k8s, Connect via servicename. #454

Closed
wants to merge 1 commit into from

Conversation

Chrisdowson
Copy link

my service run in k8s env,And I connect other service via servicename.when I run (new React\Http\Browser())->post('http://openapicenter/index'),The error message is Connection to tcp://openapicenter:80 failed during DNS lookup. Last error for IPv4: DNS query for openapicenter (A) returned an error response (Server Failure). Previous error for IPv6: DNS query for openapicenter (AAAA) returned an error response (Server Failure). My /etc/resolv.conf is search test.svc.cluster.local svc.cluster.local cluster.local nameserver 169.254.20.10 nameserver 192.168.0.10 options ndots:3 timeout:1 attempts:2

@WyriHaximus
Copy link
Member

have you tried using the FQDN? openapicenter.test.svc.cluster.local should work. As we haven't implemented the search option in the DNS packages IIRC.

@clue
Copy link
Member

clue commented May 12, 2022

@Chrisdowson Thanks for filing this PR!

As @WyriHaximus pointed out, it looks like you're affected by lack of support for the DNS search option. You can try using a FQDN as a work around in the meantime. We keep track of this feature request in reactphp/dns#158, perhaps you can help contribute to this ticket?

The PR itself should probably target the underlying DNS component instead of the higher-level HTTP layer. Also note that using gethostbyname() is inherently blocking and accordingly not something we could use in a non-blocking application. See the above DNS ticket for some further details.

I hope this helps! I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can always reopen this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants