<p>I have a cluster on EKS with some APIs running on it, this is the yaml file used to deploy them:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: &lt;api-name&gt;
spec:
  type: ClusterIP
  selector:
    app: &lt;api-name&gt;
  ports:
    - protocol: TCP
      port: 80
      targetPort: &lt;container-port&gt;
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: &lt;api-name&gt;
spec:
  replicas: 1
  selector:
    matchLabels:
      app: &lt;api-name&gt;
  template:
    metadata:
      labels:
        app: &lt;api-name&gt;
    spec:
      containers:
      - name: &lt;api-name&gt;
        image: &lt;ecr-image-url&gt;
        ports:
        - containerPort: &lt;container-port&gt;
          name: &lt;api-name&gt;
        env:
          - name: ENVIRONMENT
            value: &lt;environment&gt;
---
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  name: &lt;api-name&gt;
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
spec:
  rules:
  - host: &lt;app-name&gt;.&lt;dns&gt;
    http:
      paths:
      -  backend:
          serviceName: &lt;api-name&gt;
          servicePort: 80
</code></pre>
<p>The routing works perfectly ok (Network Load Balancer created by nginx-ingress), but when I try to make a request from one pod to another, I receive a:</p>
<pre><code>[2020-08-14 11:49:42,214] ERROR in app: Exception on /services [GET]
Traceback (most recent call last):
  File &quot;/usr/local/lib/python3.8/site-packages/flask/app.py&quot;, line 2447, in wsgi_app
    response = self.full_dispatch_request()
  File &quot;/usr/local/lib/python3.8/site-packages/flask/app.py&quot;, line 1952, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File &quot;/usr/local/lib/python3.8/site-packages/flask_cors/extension.py&quot;, line 161, in wrapped_function
    return cors_after_request(app.make_response(f(*args, **kwargs)))
  File &quot;/usr/local/lib/python3.8/site-packages/flask/app.py&quot;, line 1821, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File &quot;/usr/local/lib/python3.8/site-packages/flask/_compat.py&quot;, line 39, in reraise
    raise value
  File &quot;/usr/local/lib/python3.8/site-packages/flask/app.py&quot;, line 1948, in full_dispatch_request
    rv = self.preprocess_request()
  File &quot;/usr/local/lib/python3.8/site-packages/flask/app.py&quot;, line 2242, in preprocess_request
    rv = func()
  File &quot;/app/app/views/__init__.py&quot;, line 12, in before_rest_callback
    validate_request(token)
  File &quot;/app/app/utils.py&quot;, line 29, in validate_request
    response = httpx.post(url, headers=headers, timeout=60)
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_api.py&quot;, line 269, in post
    return request(
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_api.py&quot;, line 86, in request
    return client.request(
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_client.py&quot;, line 640, in request
    return self.send(
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_client.py&quot;, line 670, in send
    response = self._send_handling_redirects(
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_client.py&quot;, line 699, in _send_handling_redirects
    response = self._send_handling_auth(
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_client.py&quot;, line 736, in _send_handling_auth
    response = self._send_single_request(request, timeout)
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_client.py&quot;, line 759, in _send_single_request
    (
  File &quot;/usr/local/lib/python3.8/contextlib.py&quot;, line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File &quot;/usr/local/lib/python3.8/site-packages/httpx/_exceptions.py&quot;, line 359, in map_exceptions
    raise mapped_exc(message, **kwargs) from None  # type: ignore
httpx._exceptions.ReadError: Server disconnected while attempting read
</code></pre>
<p>I can get no connection between pods. The request doesn't reach the other application, running on the same cluster, same node. Nginx Ingress was installed following the <a href="https://kubernetes.github.io/ingress-nginx/deploy/#aws" rel="nofollow noreferrer">official documentation</a>.</p>
<p>Any clues about what might be causing this? I discarded anything related to the deployment (API or gunicorn in this case). It seems to be something related to the cluster and/or nginx-ingress. Tried searching about it and found stuff related to &quot;idle timeout&quot;, but that's not applicable to Network Load Balancers.</p>

<p>Problem solved using <code>http://&lt;app-name&gt;</code> (app-name being the service name). Reference: <a href="https://stackoverflow.com/questions/54949522/how-to-implement-kubernetes-pod-to-pod-communication#answer-54949627">How to implement Kubernetes POD to POD Communication?</a></p>
