<p>I have a backend Node application that runs inside kubernetes cluster (locally with minikube). The backend service is configured as following:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: flow-backend-service
spec:
  selector:
    app: flow-backend
  type: NodePort
  ports:
    - port: 5000
      targetPort: 5000
      nodePort: 30500
</code></pre>
<p>kubectl get svc outputs following line:</p>
<pre><code>flow-backend-service     NodePort    10.110.143.69    &lt;none&gt;        5000:30500/TCP   45h
</code></pre>
<p>In the same cluster I have angular application that is suposed to fetch data from this backend application. The url for backend is the following:</p>
<pre><code>backendUrl: &quot;http://flow-backend-service.default.svc.cluster.local:5000&quot;
</code></pre>
<p>However, when I run the angular application I get following response</p>
<pre><code>Http failure response for http://flow-backend-service.default.svc.cluster.local:5000/companies: 0 Unknown Error
</code></pre>
<p>One important note is that if I execute this inside the angular pod:</p>
<pre><code>curl http://flow-backend-service.default.svc.cluster.local:5000/companies
</code></pre>
<p>I get a proper response.</p>
<p>Any idea how can I debug this problem?</p>

Cosmin D
<p>The angular application runs in the users browser,  that dns address is only will only resolve within the K8s cluster.  you will either need to setup dns address(es) for the machine(s) hosting the k8s cluster.  Or use the IP address of one of the machines hosting the k8s cluster.</p>
<p>This is not a production stable setup,  I would recommend using an ingress controller and some kind of dynamic DNS resolver that integrates with K8s for example consul.</p>
<p>Disclaimer: I have no involvement with consul, its just the one I am most familiar with.</p>
