hashicorp / hashicorp/nomad

host_network (using Nebula) vs. DNS

Open
#9,006 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

stage/accepted theme/networking type/bug
Dominant language
Go
Stars
17k
Forks
2.1k
Avg merge
1d 9h
Merged PRs (30d)
105

Description

Issue

We are have a problem where the host_network doesn't act as I think it should.
Maybe this is related to https://github.com/hashicorp/nomad/issues/8432 ?
Nameservice does not return Nebula IP, but Public IP.

Nomad version

Nomad v0.12.5

Operating system and Environment details

Ubuntu 20.04 LTS
3 server nodes
1 client node
All 4 nodes are VPS'
1 public IP on each
1 Nebula network privat addresse on each

Reproduction steps

So, in short, we want to run all on our Nebula network.

As a test we've set up a PgBouncer service (Docker).

The service runs fine - but nameservice return Public IP - not the Nebula IP

I would expect the service to be announced on "default" = 192.168.100.5 but DNS tells me otherwise:

; <<>> DiG 9.16.1-Ubuntu <<>> @localhost -p 8600 pgbouncer.service.consul
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 53682
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;pgbouncer.service.consul. IN A

;; ANSWER SECTION:
pgbouncer.service.consul. 0 IN A 49.X.Y.Z

;; Query time: 4 msec
;; SERVER: 127.0.0.1#8600(127.0.0.1)
;; WHEN: Thu Oct 01 11:40:43 CEST 2020
;; MSG SIZE rcvd: 69

Nomad client node host_network setup:

...

host_network "public" {
  cidr = "49.X.Y.Z/32"
  interface = "eth0"
}

host_network "default" {
  cidr = "192.168.100.5/22"
  interface = "nebula1"
}

}

Job file (if appropriate)
job "pgbouncer" {
  datacenters = ["dc2"]
 
  type = "service"

  group "pgbouncer" {
  count = 1
  network {
    mode = "bridge"
      port "db" {
         host_network = "default"
         static = 6432
         to = 6432
      }
  }

  service {
    name = "pgbouncer"
    port = "db"
  }

  task "pgbouncer" {
    driver = "docker"
    config {
      image = "pgbouncer/pgbouncer:1.14.0"
  }

  env {
    DATABASES_HOST = "192.168.101.4"
    DATABASES_PORT = 5432
    DATABASES_USER = "postgres"
    DATABASES_PASSWORD = "<password>"
    DATABASES_DBNAME = "<dbname>"
    PGBOUNCER_LISTEN_PORT = 6432
  }
}

}
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source files or tests are named. Start by reproducing the pgbouncer service with the shown host_network and bridge-mode configuration, then query pgbouncer.service.consul through the local DNS server and compare the returned public and Nebula addresses. Done means the configured default network address is consistently returned, or the behavior is documented as unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, linux
Domain
devops, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.