Kubernetes Nginx Ingress 404 - .NET Microservice

六月ゝ 毕业季﹏ 提交于 2019-12-11 17:19:43

问题


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.

来源:https://stackoverflow.com/questions/55011641/kubernetes-nginx-ingress-404-net-microservice

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!