Kubernetes 通过 nginx ingress 路由仪表板流量

Kubernetes route dasboard traffic thru nginx ingress

我正在尝试通过 nginx 入口路由仪表板流量。我有两个集群单主机 v1.9.0 和多主机 v1.10.0。以下入口规则在单主集群中有效(curl -kv https://kubeapi.sfgroups.com/dashboard/),但在多主集群上获得 404。

单主入口版本:0.9.0-beta.19

多主入口版本:0.15.0

这是规则。

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/rewrite-target: /
    nginx.ingress.kubernetes.io/secure-backends: "true"
  name: ingress-dev-dashboard
spec:
  rules:
  - host: kubeapi.sfgroups.com
    http:
      paths:
      - backend:
          serviceName: kubernetes-dashboard
          servicePort: 443
        path: /dashboard
  tls:
  - hosts:
    - kubeapi.sfgroups.com
    secretName: kubeapi-secret

产出

    > GET /dashboard/ HTTP/1.1
> User-Agent: curl/7.29.0
> Host: kubeapi.sfgroups.com
> Accept: */*
>
< HTTP/1.1 404 Not Found
< Content-Type: text/plain; charset=utf-8
< X-Content-Type-Options: nosniff
< Date: Mon, 18 Jun 2018 21:57:38 GMT
< Content-Length: 19
<
404 page not found

有任何解决此问题的提示吗?

谢谢 SR

答案由sfgroups在评论中提供:

My request directly went to dashboard using haproxy. I have updated haproxy to point it to nginx ingress. Now it works.