<p>I have two services running in my k8s.<br />
I am trying to access my wallet service from my user service but my curl cmd just returns 504 gateway timeout.</p>
<p>here is my ingress</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: dev-ingress
  namespace: dev
  annotations:
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
    # nginx.ingress.kubernetes.io/use-regex: &quot;true&quot;
    # nginx.ingress.kubernetes.io/rewrite-target: /api/v1$uri
spec:
  ingressClassName: nginx
  rules:
  - http:
      paths:
      - path: /api/v1/wallet
        pathType: Prefix
        backend:
          service:
            name: wallet-service
            port:
              number: 80
      - path: /api/v1/user
        pathType: Prefix
        backend:
          service:
            name: accounts-service
            port:
              number: 80
</code></pre>
<p>this is the way I passed the env in my account service.</p>
<p><code>http://wallet-service:3007</code></p>
<p>and I log the URL when hitting my endpoint</p>
<p><code>curl http://EXTERNAL_IP/api/v1/user/health/wallet</code></p>
<p>every other non-related endpoint works.</p>
<p>Any help is appreciated</p>
<p>I am running Azure Kubernetes</p>

King
<blockquote>
<p>I have two services running in my k8s.</p>
</blockquote>
<ol>
<li><p>Do you have an actual K8S service?</p>
<pre class="lang-yaml prettyprint-override"><code>apiVerison: ...
kind: Service
</code></pre>
<ul>
<li>Check it with <code>kubectl get svc -A</code> and you should see your services there</li>
</ul>
</li>
<li><p>Check to see that your pods are exposed to the services</p>
<pre class="lang-bash prettyprint-override"><code>kubectl get endpoints -A
</code></pre>
</li>
<li><p>Are you running on a cloud provider (GCP, Azure, AWS, etc), if so check your security configuration as well (NSG for Azure, a security policy for AWS, etc)</p>
</li>
<li><p>Check inner communication :</p>
<pre class="lang-bash prettyprint-override"><code># Log into one of the pods 
kubectl exec -n &lt;namespace&gt; &lt;pod name&gt; sh

# Try to connect to the other service with the FQDN
curl -sv &lt;servicename&gt;.&lt;namespace&gt;.svc.cluster.local
</code></pre>
</li>
</ol>
<h3>Update:</h3>
<ul>
<li>You commented that you are running on Azure, check the desired ports are opened under the NSG.</li>
<li>Assuming that you are running AKS you need to find out the <code>MS_xxxx</code> resource and your NSG group will be located under this resource group, edit it and open the desired ports</li>
</ul>
<hr />
<p>You are trying to connect to http://wallet-service:3007/api/v1/wallet/health - Where did you get the 3007 port?</p>
