<p>I am very much new to Docker and Kubernetes. While learning Kubernetes I come to a point where I am working with <a href="https://kubernetes.github.io/ingress-nginx/" rel="nofollow noreferrer">Ingress</a>.</p>
<p>Let me share my Service and My Ingress controller YML file.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: simptekapi-api-service
spec:
  selector:
    component: api
  type: ClusterIP
  ports:
    - port: 5000
      targetPort: 5000
</code></pre>
<hr />
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: &quot;0&quot;
    nginx.ingress.kubernetes.io/proxy-read-timeout: &quot;600&quot;
    nginx.ingress.kubernetes.io/proxy-send-timeout: &quot;600&quot;
  name: docker-registry
  namespace: default
spec:
  rules:
  - host: simptek.api
    http:
      paths:
      - backend:
          serviceName: simptekapi-api-service
          servicePort: 5000
        path: /
</code></pre>
<p>The problem is I am unable to connect to my service from Bowser/Postman/Curl using My minikube Ip. or Host.</p>
<p><a href="https://i.stack.imgur.com/id9TK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/id9TK.png" alt="enter image description here" /></a></p>
<p>So I thought there might be some issue with my service. So tried to stick with Nodeport. But NodePort works just fine. So my Sevice is also fine.</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: simptekapi-api-nodeport
spec:
  type: NodePort
  selector:
    component: api
  ports:
    - port: 5000
      targetPort: 5000
      nodePort: 30007
</code></pre>
<p><a href="https://i.stack.imgur.com/QGxVd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/QGxVd.png" alt="enter image description here" /></a></p>
<p>I have also added <code>172.17.245.221 simptek.api</code> to my host file.</p>
<p>I am actually unable to figure out what I am doing wrong. I have tried to change my Ingress file several ways. Below.</p>
<pre><code>apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    nginx.ingress.kubernetes.io/proxy-body-size: &quot;0&quot;
    nginx.ingress.kubernetes.io/proxy-read-timeout: &quot;600&quot;
    nginx.ingress.kubernetes.io/proxy-send-timeout: &quot;600&quot;
  name: docker-registry
spec:
  rules:
  - host: simptek.api
    http:
      paths:
      - backend:
          serviceName: simptekapi-api-service
          servicePort: 5000
        path: /
</code></pre>
<p>also tried with adding <code>nginx.ingress.kubernetes.io/rewrite-target: /</code> to ingress.</p>
<p>I am sharing my logs which might be helpful for anybody who wants to help me.</p>
<pre><code>kubectl get pods -n kube-system

NAME                                        READY   STATUS      RESTARTS   AGE
coredns-66bff467f8-5dv28                    1/1     Running     6          7d1h
coredns-66bff467f8-w72dg                    1/1     Running     6          7d1h
etcd-minikube                               1/1     Running     0          36h
ingress-nginx-admission-create-94wpw        0/1     Completed   0          30h 
ingress-nginx-admission-patch-p5ffx         0/1     Completed   0          30h
ingress-nginx-controller-7bb4c67d67-jfdrm   1/1     Running     0          30h
kube-apiserver-minikube                     1/1     Running     0          36h
kube-controller-manager-minikube            1/1     Running     18         7d1h
kube-proxy-d5bvb                            1/1     Running     6          7d1h
kube-scheduler-minikube                     1/1     Running     17         7d1h
storage-provisioner                         1/1     Running     11         7d1h

kubectl get ing

NAME              CLASS    HOSTS         ADDRESS          PORTS   AGE
docker-registry   &lt;none&gt;   simptek.api   172.17.245.221   80      53m

kubectl describe ing docker-registry

Name:             docker-registry
Namespace:        default
Address:          172.17.245.221
Default backend:  default-http-backend:80 (&lt;error: endpoints &quot;default-http-backend&quot; not found&gt;)
Rules:
Host         Path  Backends
----         ----  --------
simptek.api
           /   simptekapi-api-service:5000 (172.17.0.10:5000,172.17.0.6:5000,172.17.0.7:5000)
Annotations:   nginx.ingress.kubernetes.io/proxy-body-size: 0
           nginx.ingress.kubernetes.io/proxy-read-timeout: 600
           nginx.ingress.kubernetes.io/proxy-send-timeout: 600
Events:
Type    Reason  Age                    From                      Message
----    ------  ----                   ----                      -------
Normal  CREATE  54m                    nginx-ingress-controller  Ingress default/docker-registry
Normal  CREATE  54m                    nginx-ingress-controller  Ingress default/docker-registry
Normal  UPDATE  3m58s (x100 over 53m)  nginx-ingress-controller  Ingress default/docker-registry
Normal  UPDATE  3m58s (x100 over 53m)  nginx-ingress-controller  Ingress default/docker-registry

kubectl get namespaces

NAME                   STATUS   AGE
default                Active   7d1h
ingress-nginx          Active   30h
kube-node-lease        Active   7d1h
kube-public            Active   7d1h
kube-system            Active   7d1h
kubernetes-dashboard   Active   7d1h
</code></pre>
<p>It would be a great help if anybody can guide me about my wrongdoings. Please Let me know any more information needed.</p>

Amjad
<p>You need to remove the below annotation from Ingress</p>
<pre><code> nginx.ingress.kubernetes.io/proxy-body-size: &quot;0&quot;
</code></pre>
