<p>I have a k8 setup that looks like this</p>
<p><code>ingress -&gt; headless service (k8 service with clusterIp: none) -&gt; statefulsets ( 2pods)</code></p>
<p>Fqdn looks like this:</p>
<pre><code>nslookup my-service
Server:         100.4.0.10
Address:        100.4.0.10#53

Name:   my-service.my-namespace.svc.cluster.local
Address: 100.2.2.8
Name:   my-service.my-namespace.svc.cluster.local
Address: 100.1.4.2
</code></pre>
<p>I am trying to reach one of the pod directly via the service using the following fqdn but not able to do so.</p>
<pre><code>curl -I my-pod-0.my-service.my-namespace.svc.cluster.local:8222
curl: (6) Could not resolve host: my-pod-0.my-service.my-namespace.svc.cluster.local
</code></pre>
<p>If I try to hit the service directly then it works correctly (as a loadbalancer)</p>
<pre><code>curl -I my-service.my-namespace.svc.cluster.local:8222
HTTP/1.1 200 OK
Date: Sat, 31 Jul 2021 21:24:42 GMT
Content-Length: 656
</code></pre>
<p>If I try to hit the pod directly using it's cluster ip,  it also works fine</p>
<pre><code>curl -I 100.2.2.8:8222
HTTP/1.1 200 OK
Date: Sat, 31 Jul 2021 21:29:22 GMT
Content-Length: 656
Content-Type: text/html; charset=utf-8
</code></pre>
<p>But my use case requires me to be able to hit the statefulset pod using fqdn i.e <code>my-pod-0.my-service.my-namespace.svc.cluster.local</code> . What am I missing here?</p>

java_doctor_101
<p>Original answer didn't clarify how OP fixed the issue, the problem was in <code>serviceName</code> property under statefulset implementation.</p>
