benc-uk / kubeview

Kubernetes cluster visualiser and graphical explorer

Home Page:http://kubeview.benco.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

serving from /kubeview

marmelin opened this issue · comments

Hi there,

thanks for the effort on kubeview. Very handy tool !

Is it possible to implement it in a way that it is served from a /kubeview instead of / ?

If I use it behind a traefik ingress controller and searching for a pathPrefix - I wanna separate it from other calls on this URL.

So a URL like http://mypc.com/kubeview would be nice .

You have the option "paths" in the section ingress in values.yaml:
https://github.com/benc-uk/kubeview/blob/master/charts/kubeview/values.yaml

Changing this value to ["/kubeview"] should solve your request.

I am facing a similar issue with an NGINX ingress.

apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/ssl-redirect: "false"
    nginx.ingress.kubernetes.io/use-regex: "true"
  labels:
    app.kubernetes.io/instance: kubeview
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: kubeview
    app.kubernetes.io/version: 0.1.17
    helm.sh/chart: kubeview-0.1.17
  managedFields:
  name: kubeview
  namespace: kubeutilities
spec:
  rules:
  - host: *****.westeurope.cloudapp.azure.com
    http:
      paths:
      - backend:
          serviceName: kubeview
          servicePort: 80
        path: /utils/kubeview(/|$)(.*)
        pathType: ImplementationSpecific
  tls:
  - hosts:
    - *****.westeurope.cloudapp.azure.com
    secretName: kubeview-cert

When i browse to /utils/kubeview i sucessfully hit the webpage, but then browser cannot retrieve the css and js, because is trying to load them from /css instead of /utils/kubeview/css

Yes this requires changes beyond just the network side
It would require changes to how the application is built and bundled with webpack, these changes have implications to things like URL paths for client side routing (it breaks)

But I can investigate

I've spent some time trying to implement this, it's just not possible to combine the bundled Vue SPA with the server + the API all on the same host under a subpath without huge amounts of code change

It becomes a huge mess really really quickly

Sorry