-
Notifications
You must be signed in to change notification settings - Fork 35
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
Add Support for Path-Based Routing in Kamal #48
Comments
@jvkassi yes, agreed. We've been talking about adding this, and I have a solution in mind that I'm starting to work on. My current thinking is we'll add a path prefix option that you can use when deploying, either in combination with host-based routing or on its own. If you specify a path prefix, then only requests that match the prefix will be routed to that service. That should be enough to have apps share a domain but split according to I expect to have something more concrete to try out for this soon. |
My usecase (with Kamal 1.9) is to have a CMS and an app server behind the same Traefik instance, on the same domain. What I do is route the root path ( I wonder how that would be able with your proposal. It would probably require either some sort of service priority (which is what Traefik offers) or some sort of negation ("not these paths"). And also, not just path prefixes, but also paths (a distinction Traefik makes as well). Would be great if that would go into your consideration! |
Great news that you are working on it, it is very similar to what I need to install multiple Odoo instances on a single server (or more than one with load balancer). Specifically, Odoo requires / requests to be routed on port 8069, while /websocket requests are routed on port 8072. Here is the nginx configuration suggested by the official documentation: I use rails and odoo and I am happy to abandon dokku and embrace kamal as soon as possible. |
I would also love to see this. Our use case would be deploying multiple Java web applications as separate docker containers as part of a large ERP system. In the Java world, you can have multiple |
My case is deloying a mastodon instance. When I convert |
Is this feature still in the cards? Was a lot easier when you were using Traefik because this was baked in and I could use Docker labels. But now I have to deploy my own proxy (Traefik/Caddy/whatever) with its own settings in addition to apps. This is workable, but annoying/more to keep track of and mess up. |
I am also waiting on this feature before migrating to kamal v2. |
@voberoi I'm curious did you turn off kamal-proxy completely and setup Traefik via |
@mkuklis I didn't. My use case is that I have a stack of monitoring tools that I deploy (prometheus, grafana, dozzle) that are basically configured the same way on a single app server. These are pretty basic app deployments. I started using accessories to deploy them in Kamal v1. I use Kamal v2 now. And I just have a separate app where:
This does the job but there are still annoying things about it --
|
@voberoi thank you so much for finding time to respond to me. Your setup makes a lot of sense given this current limitation in kamal-proxy. |
Thanks for all the suggestions on this issue so far, everyone. Apologies for the radio silence 😬 The feature is still on the cards, and it's been on my list to get it shipped. I have some sketches of how I think it should work, and I'm aiming to have a working version soon that folks can try out. Stay tuned :) |
Hey @voberoi I started to use caddy in front of kamal-proxy also . I needed it for the path based routing also. The json events that kamal proxy throws out are normally used by the ruby side, but I found I can use them with caddy and other choreography layers to react to changes in kamal. |
Currently, Kamal only supports host-based routing, which limits its flexibility when managing requests on a single domain or multiple applications under the same host. To enhance its functionality and improve usability, I suggest implementing path-based routing for the following reasons:
With path-based routing, multiple services can be deployed under a single host (e.g., example.com/app1, example.com/app2), reducing the need for additional hostnames or subdomains. This is particularly beneficial when using wildcard SSL certificates or when managing applications within a single domain.
Path-based routing allows for the separation of different applications or services under distinct paths (e.g., /api, /admin). This simplifies management and reduces complexity, especially when dealing with microservices or multiple frontends that share a domain.
The text was updated successfully, but these errors were encountered: