cnrancher / kube-explorer

A portable explorer for Kubernetes, without any dependency.
Apache License 2.0
213 stars 26 forks source link

kube-explorer does not support being installed behind a shared ingress gateway #42

Open wkbrd opened 2 months ago

wkbrd commented 2 months ago

Please enhance the software to support a prepended URI. This way we can present kube-explorer as an application behind a shared ingress gateway. For example, allow all URIs to be prepended with a configurable token (such as /kube-explorer) so that other applications can be available at other endpoints on the same public host.

A possible partial solution is if the ingress rule rewrites the URL. Though this depends on the UI being able to work with this configuration.

Right now, it appears that the following top-level endpoints are necessary (and possibly others):

orangedeng commented 1 month ago

I did a research about this topic and the followings are the key points.

It can be implemented by traefik/nginx to modify the response html content. Change the base href from /dashboard/ to /<prefix-you-need>/dashboard/ and it should be ok. That's the way how autok3s achieve this. But the response html is encoded by gzip so you might need to handle the encode/decode first.

I will suggest using sub-domain instead of sub-path if possible.