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

'default' host_network isn't found when same interface is specified under named host_network #18097

Closed
kevinschoonover opened this issue Jul 29, 2023 · 1 comment · Fixed by #18096
Assignees
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/fingerprint theme/networking type/bug
Milestone

Comments

@kevinschoonover
Copy link
Contributor

Nomad version

Output from nomad version

> nomad version
Nomad v1.6.1

Operating system and Environment details

Debian 11 x86

Issue

consider the following config.hcl

# config.hcl
client {
  network_interface = "tailscale0"

  host_network "tailscale" {
    interface = "tailscale0"
  }

  host_network "public" {
    interface = "wlan0"
  }
}

whenever you would schedule the following job

# job.hcl
job "docs" {
  datacenters = ["dc1"]

  group "example" {
    network {
      port "http" {}
    }
    task "server" {
      driver = "docker"

      config {
        image = "hashicorp/http-echo"
        ports = ["http"]
        args = [
          "-listen",
          ":5678",
          "-text",
          "hello world",
        ]
      }
    }
  }
}

you would see * Constraint "missing host network \"default\" for port \"http\"": 1 nodes excluded by filter because the 'default' host_network alias is being replaces with 'tailscale'.

I submitted #18096 which will properly append the default alias. Please let me know if there are any questions or things I can add!

@tgross
Copy link
Member

tgross commented Jul 31, 2023

Good debugging! I was able to reproduce this on a multi-homed machine and it doesn't repro if any of the elements are missing here, so I think you're on the right track. Review incoming for your PR shortly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/fingerprint theme/networking type/bug
Projects
Development

Successfully merging a pull request may close this issue.

2 participants