Kubernetes route dasboard traffic thru nginx ingress

6/18/2018

I am trying to route the dashboard traffic thru nginx ingress. I have two cluster single master v1.9.0 and multimaster v1.10.0. below ingress rules works (curl -kv https://kubeapi.sfgroups.com/dashboard/) in single master cluster, but getting 404 on multi-master cluster.

Single master ingress version: 0.9.0-beta.19

Multi master ingress version: 0.15.0

Here is the rule.

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

output

    > 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

Any tips to troubleshoot this issue?

Thanks SR

-- sfgroups
kubernetes
kubernetes-ingress
nginx

1 Answer

6/19/2018

Answer provided by sfgroups in comments:

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

-- VAS
Source: StackOverflow