opencost icon indicating copy to clipboard operation
opencost copied to clipboard

Change the context path.

Open polinchw opened this issue 2 years ago • 5 comments

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.

polinchw avatar Nov 09 '23 16:11 polinchw

Related to https://github.com/opencost/opencost-helm-chart/issues/148

mattray avatar Nov 13 '23 09:11 mattray

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.

niklastanner avatar Nov 29 '23 12:11 niklastanner

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

sethiharsh avatar Nov 30 '23 10:11 sethiharsh

We are facing the same issue. Any updates here?

dlahn avatar Mar 21 '24 14:03 dlahn

Same issue here. Any updates?

victor-a-valencia avatar May 07 '24 10:05 victor-a-valencia

@mattray anything you can share?

dwbrown2 avatar May 13 '24 19:05 dwbrown2

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

mattray avatar May 14 '24 07:05 mattray