<p>How I understand that I could be able to talk with other pods from a specific pod by sending from within the pod an HTTP request with the fully qualified domain name of the service (FQDN).
The system runs locally with minikube.</p>

<p>The service's YML - </p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: kubia
spec:
  sessionAffinity: ClientIP 
  ports:
    - port: 80
      targetPort: 8080
  selector:
    app: kubia 
</code></pre>

<p>The describe of the service -</p>

<pre><code>Name:              kubia
Namespace:         default
Labels:            &lt;none&gt;
Annotations:       &lt;none&gt;
Selector:          app=kubia
Type:              ClusterIP
IP:                10.111.178.111
Port:              &lt;unset&gt;  80/TCP
TargetPort:        8080/TCP
Endpoints:         172.17.0.7:8080,172.17.0.8:8080,172.17.0.9:8080
Session Affinity:  ClientIP
Events:            &lt;none&gt;
</code></pre>

<p>I'm trying to do that with -</p>

<pre><code> kubectl exec -it kubia-gqd5l bash
</code></pre>

<p>where kubia-gqd5l is the pod.
In the bash I tried to sent a request by -</p>

<pre><code>curl http://kubia
</code></pre>

<p>Where kubia is the name of the service.
and I got error -</p>

<blockquote>
  <p>curl: (6) Could not resolve host: kubia.</p>
</blockquote>

<p>It is important to note that I manage to communicate with the service by - </p>

<pre><code> kubectl exec kubia-gqd5l -- curl -s http://10.111.178.111
</code></pre>

<p>any idea?</p>

nirkov
<p>Kubernetes clusters usually have DNS deployed. That allows pod to pod communications <em>within</em> the cluster (among other things) by using the name of the corresponding Kubernetes services. See <a href="https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/</a></p>

<p>Does your Kubernetes cluster/minikube have DNS running?</p>

<p>Something else to check is the selector in the Service definition - make sure the pod/deployment has the <code>app: kubia</code> label as specified in the selector.</p>

<p>Otherwise, and per the doc at the link above, because the lookup of the service is from a pod in the same namespace, it shouldn't be needed to use the namespace along with the service name: (quote) "...Assume a Service named foo in the Kubernetes namespace bar. A Pod running in namespace bar can look up this service by simply doing a DNS query for foo. A Pod running in namespace quux can look up this service by doing a DNS query for foo.bar".</p>
