Question

Cannot make Pod to Service/Pod call in Kubernetes

I already set up an Kuberentes Service example-service (“example” is a substitution of the real name of my website), and then use an Ingress and the Cert Manager to expose it to the internet. If I visit https://example.com it’s working perfectly. So the example-service should be already working fine.

And then I try to make some Pod to Service calls in order to allow us to do microservices in the following days.

So I connect to a shell in a Pod in the same namespace and run wget http://example-service.default.svc.cluster.local, but it will always timeout.

I also tried to call Pod directly instead of the Service: wget http://example-pod-0x9012j.default.svc.cluster.local times out too.

I also tried wget http://non-exist-service.default.svc.cluster.local and it returns “Name or service not known” error immediately, so it seems the DNS lookup in the previous command is working.

I go back to Minikube and try the same thing out and it works. Is there any extra work to make Pod to Service/Pod working in DigitalOcean Kubernetes?

Thanks in advance.

Subscribe
Share

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Just out of curiosity, do either of these two commands work: