factorhouse / kpow

Kpow for Apache Kafka Release Artifacts
https://factorhouse.io/kpow
Apache License 2.0
38 stars 5 forks source link

UI web server context path #32

Closed justmike1 closed 2 weeks ago

justmike1 commented 3 weeks ago

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

I want to run the service in context path of /kpow, for example instead of http://localhost:3000, to be http://localhost:3000/kpow

Describe the solution you'd like

New parameter to kpow.env like SERVLET_CONTEXT_PATH = "/kpow" (default "/")

Describe alternatives you've considered

NGINX ingress won't solve the issue because it is a load balancer redirect mechanism, I want the application to run natively on the context path, like in spring you do something like: spring.server.path = /

Additional context

Is this project still maintained? if not can you recommend another?

d-t-w commented 3 weeks ago

Hi @justmike1 thanks for raising this ticket.

Normally our users would specify NGINX or Kubernetes Ingress configuration to server Kpow at a sub-path, you can find examples of that configuration here:

https://docs.factorhouse.io/kpow-ee/installation/deployment-notes/#k8s-ingress-configuration

Do you have a specific requirement where you're not using a reverse-proxy but still want Kpow served at a different path?

justmike1 commented 3 weeks ago

yes, I want to implement it as part of a bigger helm chart being abstract to the deployment method, which the user can have an ingress or a reverse proxy of his own, or just use cloud's LB. the most I am doing is adding a path in a long ingress file, including multiple services.

We used to use Kafka UI as it uses Spring boot, and it comes with a configuration in application.yml of spring.server.path: /kafkaui, but your tools seems to be more efficient and also better looking and I want to test the features. but I can't deploy it without native tomcat or the server used context path.

d-t-w commented 3 weeks ago

Thanks for the info, let me have a chat with my team about it.

We use Jetty under the covers, with websockets but without servlets (so there's no servletcontext as such) so it's slightly more complicated but is probably still something we can look at making configurable.

justmike1 commented 3 weeks ago

Understood, appreciated the effort, looking forward to use it.

d-t-w commented 3 weeks ago

Thinking about this request, I'm not sure it's something we can support.

I think you intend to deploy multiple services within a single tomcat instance? It has been a long time since I worked in Java/J2EE land but I guess you could have multiple war files running in one server on different servlet-contexts?

Kpow runs Jetty embedded and will always start a Jetty server on a port and server the UI via that mechanism, we don't provide a war or other method for running Kpow within tomcat I'm afraid.

You could always chose to start Kpow on a different port by setting the PORT environment variable and switch between services that way.

justmike1 commented 3 weeks ago

Is the source code of kpow is open source? so I will take a look how it works there

d-t-w commented 2 weeks ago

Hi @justmike1 no, Kpow is not open-source.

I'll close this ticket now as it's not possible to run Kpow as a war / in a multi-app environment within a single Tomcat instance. Your option is to use something like kpow-local if you want to run multiple services in a docker-compose style environment, or have Kpow run on its own host/ip combo if deploying within Kubernetes with Helm.