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

[question] How can host_network be working for you? #6

Closed
underyx opened this issue Mar 6, 2021 · 2 comments
Closed

[question] How can host_network be working for you? #6

underyx opened this issue Mar 6, 2021 · 2 comments
Labels
question Further information is requested

Comments

@underyx
Copy link
Contributor

underyx commented Mar 6, 2021

Hey! I know this is not really an issue to open here, but I see lots of issues on nomad already that aren't moving, and thought I'd ask you for advice as apparently you did get this working somehow. If you don't wanna deal with questions, feel free to just close this without comment, I wouldn't mind!

Anyway, you have this Nomad config here: https://github.com/mr-karan/hydra/blob/e54cbbef89dd3e953398ffd478bcb5c8846178d8/docs/SETUP.md#configurations

I've tried like five different ways of replicating this config on my Hetzner server, the latest attempt being this: https://gitlab.com/underyx/ops/-/blob/160354829bd0b4e1003ca8e6cbb8b98e9876f48d/roles/nomad/files/nomad.hcl#L21-29

But nomad node status -json -self never reports anything about having any host_networks registered, and my caddy job always fails to allocate because it says there are no nodes with a tailscale network.

So it kinda feels like host_networks are just completely broken in Nomad. How can it be working for you? 😕

@mr-karan
Copy link
Owner

mr-karan commented Mar 6, 2021

nomad node status -json -self

I didn't find any info about host_network with this command, I'm unsure if that's supposed to show up here.

Anyway, it does work for me and yes it has some rough edges which I believe some of them are fixed in 1.0.4.

nomad job inspect caddy | grep -C 5 tailscale                                    16:24:21
                        "IP": "",
                        "MBits": 0,
                        "Mode": "",
                        "ReservedPorts": [
                            {
                                "HostNetwork": "tailscale",
                                "Label": "http-internal",
                                "To": 80,
                                "Value": 80
                            },
                            {
                                "HostNetwork": "tailscale",
                                "Label": "https-internal",
                                "To": 443,
                                "Value": 443
                            },
                            {
docker ps
43eaef72b2df   mrkaran/caddy:latest       "caddy run --config …"   3 days ago     Up 3 days              100.119.138.27:80->80/tcp, 100.119.138.27:80->80/udp, 100.119.138.27:443->443/tcp, 100.119.138.27:443->443/udp, 2019/tcp                                                                 internal-6ca6aba6-b0d3-b520-fc1f-8190e3070c49

So yeah, you can see the caddy container listens on my Tailscale IP with ports defined in my Nomad spec.

@underyx
Copy link
Contributor Author

underyx commented Mar 6, 2021

Welp, thanks for getting back to me! It seems like it actually finally works for me as well, somehow :/

I just reverted to using the exact same config as you have, and caddy finally scheduled. I don't know what could've fixed it but hey, it works! Thanks a lot!

@underyx underyx closed this as completed Mar 6, 2021
@mr-karan mr-karan added the question Further information is requested label Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants