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

Change the context path. #6

Open
polinchw opened this issue Nov 9, 2023 · 7 comments
Open

Change the context path. #6

polinchw opened this issue Nov 9, 2023 · 7 comments

Comments

@polinchw
Copy link

polinchw commented Nov 9, 2023

Is your feature request related to a problem? Please describe.

I'm trying to run Opencost on Kubernetes with a Traefik Ingress route. The hostname we have is common say https://example.com. I'd like to have Opencost listen on https://example.com/opencost. I'm having issues routing to Opencost with it listening on the root context /.

Describe the solution you'd like

Is it possible to make Opencost listen on context like /opencost?

Describe alternatives you've considered

I've tried different Middlewares in Traefik to direct it to Opencost but I haven't had any luck.

@mattray
Copy link
Collaborator

mattray commented Nov 13, 2023

Related to opencost/opencost-helm-chart#148

@niklastanner
Copy link

niklastanner commented Nov 29, 2023

opencost/opencost-helm-chart#148 did not solve the problem.

Helm chart values:

opencost:
  ui:
    ingress:
      hosts:
        - host: my.url.com
          paths:
            - /opencost
      tls:
        - hosts:
            - my.url.com
    extraEnv: # Tried with both simultaneously and with each env-variable alone
      - name: BASE_URL
        value: /opencost/model
      - name: BASE_URL_OVERRIDE
        value: /opencost

exec into opencost-ui:

$ echo $BASE_URL_OVERRIDE
/opencost
$ echo $BASE_URL
/opencost/model

When calling the UI over the browser (https://my.url.com/opencost), an empty white page is being served. Network Protocol shows:

https://my.url.com/opencost - GET - 200 OK
https://my.url.com/index.89ba2f7f.css - GET - 404 Not Found
https://my.url.com/index.a13ddd66.js - GET - 404 Not Found
https://my.url.com/favicon.7eff484d.ico - GET - 404 Not Found

The ui files (index.js, etc.) should be taken from the subpath (e.g. https://my.url.com/opencost/index.a13ddd66.js) not from /

Both Pods opencost and opencost-ui do not show any logs.

@sethiharsh
Copy link

we are facing same issue to access opencost-ui on ingress sub paths.

@dlahn
Copy link

dlahn commented Mar 21, 2024

We are facing the same issue. Any updates here?

@victor-a-valencia
Copy link

Same issue here. Any updates?

@dwbrown2
Copy link

@mattray anything you can share?

@mattray
Copy link
Collaborator

mattray commented May 14, 2024

I haven't had time to address this, but I'll bump the priority

@mattray mattray transferred this issue from opencost/opencost May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants