-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Service resolution doesn't work in minikube #314
Comments
Can you share the logs from your application just to confirm it is DNS resolution & not service timing out or something like that? Can you also confirm that the redis pods are up & that the redis-service has valid endpoints as expected? |
To check DNS, could you try something like this:
Then run: That should return something like 10.0.0.1 if DNS is working. |
Any luck here? |
I switched from 'dns' to 'env'. It worked then. When I switched back from 'env' to 'dns', it continued working. Not sure what changed (other than discovery type), but it continued working with 'dns'. Fyi (not sure if it matters), I am running all of this locally on a mac. Thanks !! |
More info: My docker image is a pretty minimal ubuntu image . It doesn't have nslookup installed on it, but when I installed and ran nslookup kubernetes.default, it did show 10.0.**, which means DNS is working? Should be a separate thread, I guess, but what are some of the best practices in debugging services. Sometimes, my services says it is in pending state on the dashboard ( And sometimes, service doesn't respond at all and times out, and I don't see any logs on my application pods (pods which are being proxied by the service). So quite sure, requests haven't reached the application pod, but are being interrupted before.. |
Closing this issue, since this particular issue is not a issue anymore. |
This is closed, but its the first thing that comes up when a newbie searches "kubernetes services dont work in minikube". Turns out, in minikube, you have to provide a In Kube on AWS, kube-on-mac, and every other kube environment I've used, setting no
Seems to make services work! I believe this is still an open bug (because IMO you shouldnt have to provide that env line) Hope this helps someone else banging their head against minikube like I was :) |
Thank you so much @erulabs! That caused a lot of confusion for me. How come |
Hello
Copying a question I have asked on stackoverflow couple of days back
I installed minikube to use kubernetes locally. I was able to create pods and services locally.
However, pods (and containers) running on them, cannot resolve services using service names.
Example: I have redis service running that acts a proxy for redis pods.
kubectl get services
shows taht redis service has been created.However, when my web application tries to connect to
redis-service
, I get connection timeout, because web application (pod) cannot resolveredis-service
.Is there anything special taht needs to be installed to get service resolution working locally.
this is the output of running
kubectl get services
However, same yaml files when executd in Google Container Engine work fine. They are able to find services
The text was updated successfully, but these errors were encountered: