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

Resolving the main app via DNS from an accessory container #1278

Open
juliusv opened this issue Dec 8, 2024 · 8 comments
Open

Resolving the main app via DNS from an accessory container #1278

juliusv opened this issue Dec 8, 2024 · 8 comments

Comments

@juliusv
Copy link

juliusv commented Dec 8, 2024

I'm not sure if this is a feature request or is already possible somehow: I want to reach my main Kamal app from an accessory container (in my specific case, the accessory container is a Prometheus server scraping the /metrics endpoint of the main app). However, I've been unable to find any stable DNS name for the main app, since the container name changes each time the app is deployed, and even that one is not reachable. I was only able to resolve something like 168.146.123.140-53f792ef1caf, which is listed as the Hostname in docker inspect.

It would be nice to make the main app resolvable under a predictable and stable DNS name from the other containers, like it's currently possible to resolve accessories from the main app.

@frenkel
Copy link

frenkel commented Dec 16, 2024

Seems you can use something like this: #1091 (especially the last comment). Haven't been able to test it myself though.

@juliusv
Copy link
Author

juliusv commented Dec 16, 2024

@frenkel Thanks, that worked for me :) (just that host: from the example needs to be hosts: now and expects a list)

@frenkel
Copy link

frenkel commented Dec 16, 2024

Great! Maybe you should close this issue then?

@juliusv
Copy link
Author

juliusv commented Dec 16, 2024

Maybe you should close this issue then?

I was wondering that as well, it depends on how hacky we judge the linked solution to be I'd say :) Maybe it'd still be nice to support a stable hostname for the app by default, or at least make it a more explicit Kamal setting than having to pass in custom Docker options?

@viktorianer
Copy link

Maybe it'd still be nice to support a stable hostname for the app by default

I would prefer this solution and should be easy to do, as it needs only a name passed to the Docker commands?!

@juliusv
Copy link
Author

juliusv commented Dec 18, 2024

I agree it's very easy once you know about it, but it's not documented and I would not otherwise have easily figured it out.

I think since this is going to be a common need it should be at least documented then? But even better if there was just a stable name by default.

@viktorianer
Copy link

But even better if there was just a stable name by default.

I think you misunderstood my comment. No one should have to search the README to solve this issue (not easy to identify).

My point was precisely this: all containers should have a default name, and implementing that should be straightforward.

PS: Before the new year, I won’t have any time to look into this. Additionally, I have several other open tasks in the Rails repository that I’d like to start/finish first. 🤷🏼‍♂️

@juliusv
Copy link
Author

juliusv commented Dec 19, 2024

@viktorianer Sorry, I misread you indeed! Yes, that sounds good :)

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

No branches or pull requests

3 participants