<p>I am trying to configure a hello world application using ingress in GKE. I have been referring a GCP official documentation to deploy an application using Ingress.</p>
<p><a href="https://cloud.google.com/community/tutorials/nginx-ingress-gke" rel="nofollow noreferrer">Deploying an app using ingress</a></p>
<p>But this does not work i have tried to refer several documents but none of those work. I have installed the ingress controller in my kubernetes cluster.</p>
<p><code>kubectl get svc -n ingress-nginx </code> returns below output</p>
<pre><code>NAME                                 TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)     
AGE
ingress-nginx-controller             LoadBalancer   10.125.177.232   35.232.139.102   80:31835/TCP,443:31583/TCP   7h24m
</code></pre>
<p><code>kubectl get pods-n ingress-nginx</code> returns</p>
<pre><code>NAME                                        READY   STATUS      RESTARTS   AGE
ingress-nginx-admission-create-jj72r        0/1     Completed   0          7h24m
ingress-nginx-admission-patch-pktz6         0/1     Completed   0          7h24m
ingress-nginx-controller-5cb8d9c6dd-vptkh   1/1     Running     0          7h24m
</code></pre>
<p><code>kubectl get ingress</code> returns below output</p>
<pre><code>NAME               CLASS    HOSTS                   ADDRESS       PORTS   AGE
ingress-resource   &lt;none&gt;   35.232.139.102.nip.io   34.69.2.173   80      7h48m
</code></pre>
<p><code>kubectl get pods</code> returns below output</p>
<pre><code>NAME                         READY   STATUS    RESTARTS   AGE
hello-app-6d7bb985fd-x5qpn   1/1     Running   0          43m
</code></pre>
<p><code>kubect get svc</code> returns below output</p>
<pre><code>NAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
hello-app    ClusterIP   10.125.187.239   &lt;none&gt;        8080/TCP            43m
</code></pre>
<p>Ingress resource yml file used</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
spec:
  rules:
  - host: 35.232.139.102.nip.io
    http:
      paths:
      - pathType: Prefix
        path: &quot;/hello&quot;
        backend:
          service:
            name: hello-app
            port:
              number: 8080
</code></pre>
<p>Can someone tell me what i am doing wrong ? When i try to reach the application its not working.</p>

sidharth vijayakumar
<p>So I have installed Ingress-controller and used ingress controller ip as the host in my ingress file.</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress-resource
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;false&quot;
spec:
  rules:
  - host: &quot;35.232.139.102.nip.io&quot;
    http:
      paths:
      - pathType: Prefix
        path: &quot;/hello&quot;
        backend:
          service:
            name: hello-app
            port:
              number: 8080

</code></pre>
<p>Issue here was I forgot to add the IP from which I was accessing the application. When you create a GKE cluster there will be a firewall with the <code>cluster-name-all</code> in this firewall you will need to add your IP address of the machine from which you are trying to access the application. Also ensure that the port number is also exposed in my case both were not provided hence it was failing.</p>
