3

I'm trying to perform curl to my pod from another pod in a Kubernetes cluster.

$ kubectl version --short
Client Version: v1.17.0
Server Version: v1.16.14

To do so, I tried the following commands:

$ kubectl run curl-performer --image=radial/busyboxplus:curl -i --tty --rm
If you don't see a command prompt, try pressing enter.

$  curl -XGET http://account-server.console.svc:9090
curl: (6) Couldn't resolve host 'account-server.console.svc'

But nslookup works fine.

$ nslookup account-server.console.svc
Server:    10.245.0.10
Address 1: 10.245.0.10 kube-dns.kube-system.svc.cluster.local

Name:      account-server.console.svc
Address 1: 10.245.87.129 account-server.console.svc.cluster.local

What am I missing here?

Update:

Complete form of DNS address doesn't work either:

$ curl -XGET http://account-server.console.svc.cluster.local:9090
curl: (6) Couldn't resolve host 'account-server.console.svc.cluster.local'
Masudur Rahman
  • 1,585
  • 8
  • 16
  • I think your dns name is referred incorrectly, it should follow this format `svc.namespace.svc.cluster.local`. Could you try with `curl -XGET http://account-server.console.svc.cluster.local:9090`? – Jakub Oct 16 '20 at 06:40
  • @Jakub That doesn't work either. Updated my question. – Masudur Rahman Oct 16 '20 at 10:13
  • What is your infrastructure? All you'r pods in kube-system are up and running? Could you check if you can curl it with `service_ip:port` and `pod_ip:port`? – Jakub Oct 22 '20 at 07:13

0 Answers0