<p>I have some troubles to setup an ingress resource on top of a GKE cluster.
I'm having a <strong>404 error response</strong> on any type of HTTP requests.
The following are my deployment, service and ingress configurations:</p>
<p>Deployment and service:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: snap-api
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: snap-api
  template:
    metadata:
      labels:
        app: snap-api
    spec:
      serviceAccountName: snap-ksa
      containers:
      - image: eu.gcr.io/snap-xxx/services/snap-api:latest
        imagePullPolicy: Always
        name: snap-api
        ports:
        - containerPort: 5001
          protocol: TCP
        resources:
          requests:
            memory: &quot;200Mi&quot;
            cpu: &quot;200m&quot;
          limits:
            memory: &quot;1Gi&quot;
            cpu: &quot;1&quot;            
        env:
          - name: ASPNETCORE_ENVIRONMENT
            value: Production
          - name: CONFIG_CONNECTION_STRING
            valueFrom:
              secretKeyRef:
                name: snap-secrets
                key: config_connection_string
          - name: DATA_CONNECTION_STRING
            valueFrom:
              secretKeyRef:
                name: snap-secrets
                key: data_connection_string
          # TODO: Dev cert               
          - name: TLS_KEY_PATH
            value: /app/aspnetapp.pfx
          - name: TLS_KEY_PASSPHRASE
            valueFrom:
              secretKeyRef:
                name: snap-secrets
                key: tls_key_passphrase   
      - name: cloud-sql-proxy
        image: gcr.io/cloudsql-docker/gce-proxy:1.17
        command:
          - &quot;/cloud_sql_proxy&quot;
          - &quot;-instances=snap-xxx:europe-west1:snap-tenant-db=tcp:1433&quot;
        securityContext:
          runAsNonRoot: true
        ports:
        - containerPort: 1433
          protocol: TCP          
        resources:
          requests:
            memory: &quot;500Mi&quot;
            cpu: &quot;1&quot;
          limits:
            memory: &quot;2Gi&quot;
            cpu: &quot;1&quot;                 
      restartPolicy: Always
---
apiVersion: v1
kind: Service
metadata:
  name: snap-api-service
  namespace: default
spec:
  type: NodePort
  selector:
    app: snap-api
  ports:
    - targetPort: 5001
      name: http
      protocol: TCP
      port: 60000
</code></pre>
<p>And the ingress:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: snap-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - http:
        paths:
        - pathType: Prefix
          path: /api/*
          backend:
            service:
              name: snap-api-service
              port: 
                number: 60000
</code></pre>
<p>I was wondering that can by a firewall problem? Also healt checks are failing on my service...
The following is the output of &quot;kubectl describe ingress snap-ingress&quot; command:</p>
<pre><code>Name:             snap-ingress
Namespace:        default
Address:          x.x.x.x
Default backend:  default-http-backend:80 (10.6.0.2:8080)
Rules:
  Host        Path  Backends
  ----        ----  --------
  *
              /api/*   snap-api-service:60000 (10.6.0.130:5001)
Annotations:  ingress.kubernetes.io/backends:
                {&quot;k8s-be-31084--19bd63f37342a0f0&quot;:&quot;HEALTHY&quot;,&quot;k8s1-19bd63f3-default-snap-api-service-60000-d79961e6&quot;:&quot;UNHEALTHY&quot;}
              ingress.kubernetes.io/forwarding-rule: k8s2-fr-2zv080r1-default-snap-ingress-4rmjay2y
              ingress.kubernetes.io/target-proxy: k8s2-tp-2zv080r1-default-snap-ingress-4rmjay2y
              ingress.kubernetes.io/url-map: k8s2-um-2zv080r1-default-snap-ingress-4rmjay2y
              nginx.ingress.kubernetes.io/rewrite-target: /
  Type    Reason     Age                   From                     Message
  ----    ------     ----                  ----                     -------
  Normal  Sync       7m18s                 loadbalancer-controller  UrlMap &quot;k8s2-um-2zv080r1-default-snap-ingress-4rmjay2y&quot; created
  Normal  Sync       7m16s                 loadbalancer-controller  TargetProxy &quot;k8s2-tp-2zv080r1-default-snap-ingress-4rmjay2y&quot; created
  Normal  Sync       7m6s                  loadbalancer-controller  ForwardingRule &quot;k8s2-fr-2zv080r1-default-snap-ingress-4rmjay2y&quot; created
  Normal  IPChanged  7m6s                  loadbalancer-controller  IP is now x.x.x.x
  Normal  Sync       112s (x6 over 8m50s)  loadbalancer-controller  Scheduled for sync
</code></pre>

Matteo Tosato
<p>After a few days it seems to have been decisive to implement the health check on the Web Api application at the url: &quot;/&quot;.
After this change, it began to work.</p>
