Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use PathPrefix on Traefik #1005

Closed
VincentSurelle opened this issue Apr 11, 2019 · 3 comments · Fixed by #1032
Closed

Use PathPrefix on Traefik #1005

VincentSurelle opened this issue Apr 11, 2019 · 3 comments · Fixed by #1032
Labels
awaiting-more-evidence Need more info to actually get it done.

Comments

@VincentSurelle
Copy link

VincentSurelle commented Apr 11, 2019

Hi,

I'm trying to deploy Kubeapps behind Traefik proxy.

I saw many solutions using a subdomain like kubeapps.example.com, but I'm trying to make it work as example.com/catalog.

For this, i'm using Traefik ingress with PathPrefix(Strip) solution

Here is my values.yml

ingress:
  enabled: true
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/rule-type: PathPrefix
    traefik.ingress.kubernetes.io/auth-type: "basic"
    traefik.ingress.kubernetes.io/auth-secret: "auth-http"
  hosts:
  - name: mykube.example.com
    path: /catalog

With the PathPrefixStrip way, It's all blank since js & css files doesn't use the prefix /catalog

But with the PathPrefix way, I can see the UI, I'm being redirected to /login but can't see any content. Apparently there's a HEAD request triggered on / that returns a 404. Because it doesn't take the prefix.

Capture d’écran 2019-04-11 à 08 52 51

Is there a way to fix it ?

Thanks

@prydonius
Copy link
Contributor

Hey @VincentSurelle, sorry for the late response, a few of us have been travelling and on holiday.

I don't really have much experience with Traefik, but PathPrefix should work assuming this preserves the prefix when passing it to the Kubeapps nginx Pods. The rewrites configured for the dashboard nginx Pod should handle a path correctly: https://github.com/kubeapps/kubeapps/blob/52eb0a66988d3c5b711e0024a88c18a29ab67ca9/chart/kubeapps/templates/dashboard-config.yaml#L23-L35. You could take a look at the logs of that Pod to see if something strange is going on there?

@arapulido arapulido added the awaiting-more-evidence Need more info to actually get it done. label Apr 22, 2019
@micafer
Copy link

micafer commented May 14, 2019

I have the same issue using a nginx ingress controller.
I do not enable ingress in the chart (as I don't want to set a host name) and I create this ingress YAML manually:

---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  namespace: kubeapps
  name: kubeapps
  annotations:
      kubernetes.io/ingress.class: nginx
      nginx.ingress.kubernetes.io/proxy-read-timeout: "600"
spec:
  rules:
    - http:
        paths:
        - backend:
            serviceName: kubeapps
            servicePort: 80
          path: /kubeapps

As @VincentSurelle I can see the UI, I'm being redirected to /login but no login form is shown.
I see the same behaviour: It seems that there's a HEAD request triggered on / that returns a 404.
My chrome sais that the error is raised in file xhr.js (line 178).

Furthermore if I change the path to "/" I can see the login and access the application. Then I change the path in the ingress rule to "/kubepass" and I can access this path and access the application (as no login is required).

I'm using version 1.3.2 of kubeapps.

@andresmgot
Copy link
Contributor

I can reproduce the issue. The problem is that we are hard-coding the root path while it should be relative. Let me send a PR for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-more-evidence Need more info to actually get it done.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants