title: How to make HTTP call to pod running in Docker Desktop (Kubernetes)
body: <p>So I am having an issue where I get ERR_CONNECTION_REFUSED when I try to make a call from my frontend which is setup as an Ingress. My backend express server is running on port 5000 and is setup as ClusterIP. I've read the docker for mac local cluster ip is the same as localhost so thats how I have it set.</p>
  
  <p>I am confident I have the files and networking correctly. I am just not sure where to aim the API call to the backend. Is it also localhost? I will include the files below.</p>
  
  <p>Frontend deployment</p>
  
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: frontend-deployment
  spec:
    selector:
      matchLabels:
        app: frontend
    template:
      metadata:
        labels:
          app: frontend
      spec:
        containers:
        - name: frontend-container
          image: mrich6347/vue-frontend:5
          resources:
            requests:
              memory: "32Mi"
              cpu: "100m"
            limits:
              memory: "128Mi"
              cpu: "500m"
          ports:
          - containerPort: 8080
  </code></pre>
  
  <p>Frontend service</p>
  
  <pre><code>apiVersion: v1
      kind: Service
      metadata:
        name: frontend-service
      spec:
        type: ClusterIP
        selector:
          app: frontend
        ports:
        - port: 8080
          targetPort: 8080
  </code></pre>
  
  <p>Express server deployment</p>
  
  <pre><code>apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: express-server-deployment
  spec:
    selector:
      matchLabels:
        app: express-server
    template:
      metadata:
        labels:
          app: express-server
      spec:
        containers:
        - name: express-server
          image: mrich6347/express-server:5
          resources:
            requests:
              memory: "32Mi"
              cpu: "100m"
            limits:
              memory: "128Mi"
              cpu: "500m"
          ports:
          - containerPort: 5000
  </code></pre>
  
  <p>Express server service</p>
  
  <pre><code>apiVersion: v1
  kind: Service
  metadata:
    name: express-server-service
  spec:
    type: ClusterIP
    selector:
      app: express-server
    ports:
    - port: 5000
      targetPort: 5000
  </code></pre>
  
  <p>Here is my api call from vue</p>
  
  <pre><code>export default {
    name: 'app',
    components: {
      HelloWorld
    },
    created: async () =&gt; {
      console.log("SERVER IS UP")
      let res = await axios.get("http://127.0.0.1:5000/test");
      console.log(res)
    }
  }
  </code></pre>
  
  <p>And finally my simple express API</p>
  
  <pre><code>const app = require('express')();
  var cors = require('cors')
  
  app.use(cors())
  
  app.get("/test", (req, res) =&gt; {
      res.send("WORKING!")
  })
  
  
  app.listen(5000, () =&gt; {
      console.log("Server is up on 5000")
  })
  </code></pre>
  
  <p>Ingress Controller</p>
  
  <pre><code>apiVersion: extensions/v1beta1
  kind: Ingress
  metadata:
    name: traffic-router
    annotations:
      ingress.kubernetes.io/rewrite-target: /
  
  
  spec:
    rules:
      - http:
          paths:
            - path: /
              backend:
                serviceName: frontend-service
                servicePort: 8080
  </code></pre>