-
Notifications
You must be signed in to change notification settings - Fork 40k
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
Cannot access service from within a pod #73481
Comments
/sig cli |
I was able to reproduce the error with the mentioned setup (MacOS, Minikube, k8s v1.13.2). Minikube is using coredns instead of kube-dns.
I followed then the instructions here to debug the problem -> no success ns lookup in the cluster seems to be ok
/etc/resolv.conf seems to beok
coredns pods seem to be ok
DNS service seems to be ok
Endpoints are exposed, although on the page the IPs start with 10.* and here with 172.*
With enabled logging I see that the coredns pod gets the request
I tried to patch the deployment as described here -> no success I found this issue in the minikube project, which sounds similar: Although I couldn't solve the problem I hope this analysis can help somehow. |
Drive-by insufficiently-detailed comment: the bug is probably that you need to enable "hairpin mode" in the network plugin (to allow a packet to leave the pod and then be routed back into it [after iptables rewrites] rather than being routed to a different destination). I don't know how you would do this in your environment. |
@jiashenC : is this issue still alive? if yes, did you try to follow advice from @danwinship , here ? |
Reopen if it is still an issue. |
What happened:
I have a simple Kubernetes Service standup and it is backed by a single Pod. I go inside the docker container for that Pod by
docker exec -it k8s_test_test-deployment-58b575b599-zlpb5_default_4cc8f312-23e1-11e9-acf6-0800273e509f_0 bash
. I try tocurl test
to access the Service, but it receives connection timeout error. I also test bycurl <Pod IP>:8080
, which works without any issue.What you expected to happen:
curl test
orcurl <service name>
also works without any issue inside the container.How to reproduce it (as minimally and precisely as possible):
I use
minikube
on MacOS to test the Kubernetes setup. Below are my k8s config file and docker file. You can build a very simple test imagedocker build --tag=test .
and test it in your environment.config.yml
Dockerfile
Anything else we need to know?:
I use
nslookup test
, and it returns the correct Service IP attached totest
. I don't think this issue has anything to do with DSN service.curl -v test
prints out the following error.Here is my original post on StackOverflow.
Environment:
kubectl version
):uname -a
):The text was updated successfully, but these errors were encountered: