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

(fix) use network_mode host for Docker driver #2

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

gmemstr
Copy link

@gmemstr gmemstr commented Mar 30, 2023

This is because the configuration causes the application to try to reach out to the local host (127.0.0.1) but the Docker driver defaults to bridge mode. By explicitly defining host in the config we can reach the redis instance.

I don't know if this was intentional, or a misconfiguration of my setup, but out of the box the examples don't seem to work :)

This is because the configuration causes the application to try to reach out to the local host (127.0.0.1) but the Docker driver defaults to bridge mode. By explicitly defining host in the config we can reach the redis instance.
@MightyCreak
Copy link

Thanks! It indeed fixed the issue I had with jobs not able to connect to the Redis server (as described in #3).

@chronicc
Copy link

@tunzor Is there a reason this fix is still not merged? The PR fixes a real problem which every person runs into that is starting out with Nomad. The guide leads newcomers into a cul-de-sac relying on this repository.

@tunzor
Copy link
Contributor

tunzor commented Jun 26, 2023

Hey all, thanks so much for your interest and help in improving the get started guides!

We updated the guide about a month ago with new instructions that help with the issue around local Docker networking with localhost.

The Create the cluster section has information about networking with localhost (and why it doesn't work) and shows how to use the -network-interface flag to solve the issue. We chose this solution as it keeps the example app jobspecs as generic as possible so that they can also be used for the cloud path in the get started guide.

@gmemstr could you try out the updated guide and see if it works for you? If so, we can close this as resolved. Thanks!

@chronicc
Copy link

chronicc commented Jul 3, 2023

@tunzor Thank you for the insights. I just want to give the hint, that the guide about the pytechco jobs still refers to using the cluster ip address instead of localhost to reach the web ui.

I guess this causes the main problems in this scenario.

Would't it be better to also update this guide to refer to http://localhost:5000 for visiting the simulation web ui?

@hashicorp-cla
Copy link

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@MattJustMatt
Copy link

@tunzor thanks for the added section. On Mac with Homebrew, a service was auto created and started for me. I had erroneously assumed that this service would be bound similar to the example but had to go back. Not sure if it's worth a callout but it was an extra step and some troubleshooting for me.

@shide1989
Copy link

shide1989 commented Nov 8, 2023

Personnaly i'm unable to make the tutorial work. Spent already 3h trying to figure it out, make it all work, change the Docker network mode to "host", but the then the pytechco-web gets unreachable. For now i'll wait for further updates

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 this pull request may close these issues.

7 participants