Kubernetes Nginx Ingress 404 - .NET Microservice

3/5/2019

I am trying to startup a .NET k8s cluster running inside the Docker for Windows client. I setup an ingress controller like so:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: ingress-service
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - http:
        paths:
          - path: /identity/
            backend:
              serviceName: identity-cluster-ip-service
              servicePort: 5050

With example identity service configured like so:

apiVersion: v1
kind: Service
metadata:
  name: identity-cluster-ip-service
spec:
  type: ClusterIP
  selector:
    component: identity-service
  ports:
    - port: 5050
      targetPort: 5050

The ingress seems to start but when I go to localhost/identity I get a 404 Not Found. The service starts just fine under IIS and docker expose. Other than double checking the ports and the labels, I also made sure that the app returns 200 OK on default "/" route to pass the health check.

-- qubits
.net
docker
kubernetes
kubernetes-ingress
nginx-ingress

0 Answers