-
Notifications
You must be signed in to change notification settings - Fork 458
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
Proxy for accessories #981
base: main
Are you sure you want to change the base?
Conversation
2c6010d
to
63bf121
Compare
I don't think we want to start supporting accessories with kamal - if there are two things that require proper Kamal deployments, we could have two separate sets of deploy files. |
I didn't think about having a separate deploy file. I will check and come back to you. |
just to add to the convo: I'm running a couple of accessories on |
@luizkowalski I also run Grafana and PgHero. As a workaround for now, you can deploy manually after the accessory was started. docker exec 3a34b6c08923 kamal-proxy deploy onetribe-pghero --target c67f2259dce6:8080 --host pghero.onetribe.team --health-check-path / |
which container is |
Sorry it wasn't clear, so
|
I can't do it for some reason:
and the logs are just
I can |
Maybe you are using the wrong health check path? |
yup, that was it. I was pointing to |
@igor-alexandrov, @luizkowalski - what were you using Traefik for with those accessories, compared to just publishing them directly? You can run Traefik as an accessory as well. You can either run it in front of everything if you want it on ports 80/443, so you could just stand it up an different ports and configure the accessories to use it (see https://kamal-deploy.org/docs/upgrading/continuing-to-use-traefik/ for more details). |
@djmb Donal, having PgHero and probably other monitoring dashboards as accessories is easier compared to deploying them as a separate application (however I think this is possible too). So the question is, why the database is an accessory, but a monitoring tool for this database should be a separate application? |
I deployed them to umami:
image: umamisoftware/umami:postgresql-v2.13.2
hosts:
- web
env:
clear:
DATABASE_URL: <%= ENV["UMAMI_DATABASE_URL"] %>
APP_SECRET: <%= ENV["UMAMI_SECRET_KEY_BASE"] %>
DATABASE_TYPE: postgresql
labels:
traefik.http.routers.umami.rule: Host(`msg.domain.com`)
traefik.http.routers.umami.service: sumiu-umami@docker
traefik.http.routers.umami.tls: true it is incredibly helpful
I know but not only feels like a hack, I'd need to add one more accessory and maintain it. would be much easier if this behavior was native |
ah one more thing i remembered: the "args" option is not available for accessories so all the configurations im currently doing for traefik would have to be clumped under "cmd" and i found it difficult to do it |
c2f8600
to
c17bf6c
Compare
This has been rebased. |
@djmb For me there would be 2 advantages of using kamal proxy for accessories:
|
I'm starting to run into this now as well with a project I'm upgrading from 1.8 to 2. It'd be great to be able to easily support accessories connecting to kamal-proxy instead of having to bring back traefik or caddy to accomplish this. |
2b4cb8f
to
bdd111b
Compare
I rebased the PR and solved the conflicts. |
Thanks for the thoughts on this everyone. I've been pushing back against this mainly because there are other ways to achieve the same thing and also once you make a change like this you can't go back. But the compelling argument for me is that this will make it easy to set up your own registry. You'd still need to supply a hostname and authentication for the registry so it's not completely plug and play yet but still a big improvement. @igor-alexandrov - I don't have time to review this right now but I'll get to it soon 👍 |
@djmb Donal, if you need any clarifications on what has been done – please let me know. We can do a call if required. |
This PR adds functionality similar to what Traefik provided Host middleware for accessories.
Some accessories like PGHero require to be deployed to kamal-proxy to provide web interface.
This PR also includes changes from #988.