Skip to content
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

Multiple hosts per service #14

Closed
kevinmcconnell opened this issue Sep 16, 2024 · 2 comments · Fixed by #24
Closed

Multiple hosts per service #14

kevinmcconnell opened this issue Sep 16, 2024 · 2 comments · Fixed by #24
Assignees

Comments

@kevinmcconnell
Copy link
Collaborator

kevinmcconnell commented Sep 16, 2024

We should allow multiple hosts to map to a single service. For example:

kamal-proxy deploy myapp --target=web-1:3000 --host=app.example.com,api.example.com

This needs to be supported for the routing, and for the auto-TLS support. For the former, we can restructure the service map into two collections: the "main" service map, mapping name->service, and a "routing" map, mapping hostname->service.

For the latter, we'll include all the hostnames in the certificate management for that service.

@nickpoorman
Copy link

Not sure if we can yet do the following. Maybe with multiple instances of kaml-proxy pointing to the same service?

Preferably, each host would be able to acquire an ssl cert for it's domain (and not just wildcard certs for subdomains). For example:

kamal-proxy deploy myapp --target=web-1:3000 --hosts="example.com,foo.com" --tls
  1. example.com should route to web-1:3000 with a valid example.com cert.
  2. foo.com should route to web-1:3000 with a valid foo.com cert.

@kevinmcconnell
Copy link
Collaborator Author

@nickpoorman That's what this feature will allow, yes! (Sorry, I see now my example command in the description was wrong before, which made this quite confusing! Fixed now. Thanks for drawing attention to that.)

This will still be using a single instance of kamal-proxy, but it gives it the ability to associate multiple hosts (and their certs) with a single service & target, exactly as you've described there.

This feature is still in progress, but I should have something ready to try soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants