<p>I'm trying to expose my backend API service using the nginx Ingress controller. Here is the Ingress service that I have defined:</p>

<pre><code>apiVersion: extensions/v1beta1
kind: Ingress
metadata: 
  name: plant-simulator-ingress
  namespace: plant-simulator-ns
  annotations:
    ingress.kubernetes.io/enable-cors: "true"
    kubernetes.io/ingress.class: nginx
    # nginx.ingress.kubernetes.io/rewrite-target: /
    prometheus.io/scrape: 'true'
    prometheus.io/path:   /metrics
    prometheus.io/port:   '80'
spec:
  rules:
    - host: grafana.local
      http:
        paths: 
          - backend: 
              serviceName: grafana-ip-service
              servicePort: 8080

    - host: prometheus.local
      http:
        paths: 
          - backend: 
              serviceName: prometheus-ip-service
              servicePort: 8080 

    - host: plant-simulator.local
      http:
        paths: 
          - backend: 
              serviceName: plant-simulator-service
              servicePort: 9000 
</code></pre>

<p>The plant-simulator-service is defined as a service:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: plant-simulator-service
  namespace: plant-simulator-ns
  labels:
    name: plant-simulator-service
spec:
  ports:
    - port: 9000 
      targetPort: 9000 
      protocol: TCP
      name: plant-simulator-service-port
  selector:
    app: plant-simulator
  type: LoadBalancer
</code></pre>

<p>I successfully deployed this on my Minikube and here is the set of pods running:</p>

<pre><code>Joes-MacBook-Pro:~ joesan$ kubectl get pods --all-namespaces
NAMESPACE            NAME                               READY   STATUS    RESTARTS   AGE
kube-system          coredns-6955765f44-cvblh           1/1     Running   0          39m
kube-system          coredns-6955765f44-xh2wg           1/1     Running   0          39m
kube-system          etcd-minikube                      1/1     Running   0          39m
kube-system          kube-apiserver-minikube            1/1     Running   0          39m
kube-system          kube-controller-manager-minikube   1/1     Running   0          39m
kube-system          kube-proxy-n6scg                   1/1     Running   0          39m
kube-system          kube-scheduler-minikube            1/1     Running   0          39m
kube-system          storage-provisioner                1/1     Running   0          39m
plant-simulator-ns   flux-5476b788b9-g7xtn              1/1     Running   0          20m
plant-simulator-ns   memcached-86bdf9f56b-zgshx         1/1     Running   0          20m
plant-simulator-ns   plant-simulator-6d46dc89cb-xsjgv   1/1     Running   0          65s
</code></pre>

<p>Here is the list of services:</p>

<pre><code>Joes-MacBook-Pro:~ joesan$ minikube service list
|--------------------|-------------------------|-----------------------------|-----|
|     NAMESPACE      |          NAME           |         TARGET PORT         | URL |
|--------------------|-------------------------|-----------------------------|-----|
| default            | kubernetes              | No node port                |
| kube-system        | kube-dns                | No node port                |
| plant-simulator-ns | memcached               | No node port                |
| plant-simulator-ns | plant-simulator-service | http://192.168.99.103:32638 |
|--------------------|-------------------------|-----------------------------|-----|
</code></pre>

<p>What I wanted to achieve is that my application backend is reachable via the dns entry that I have configured in my Ingress - </p>

<blockquote>
  <p>plant-simulator.local</p>
</blockquote>

<p>Any ideas as to what I'm missing?</p>

<p>OP reported the case was solved by adding the IP and Hostname in the <code>/etc/hosts</code></p>

<pre><code>$ cat /etc/hosts
127.0.0.1       localhost
::1             localhost ip6-localhost ip6-loopback
192.168.99.103  plant-simulator.local
</code></pre>
