nomad icon indicating copy to clipboard operation
nomad copied to clipboard

Consul Ingress Gateway config incorrectly requires Hosts value

Open mikenomitch opened this issue 4 years ago • 0 comments

Nomad version

1.1.2

Issue

When configuring a Consul Ingress Gateway using Nomad, if you do not provide a "hosts" value, Nomad throws an error. The relevant code is here - https://github.com/hashicorp/nomad/blob/v1.1.2/nomad/structs/services.go#L1749-L1751

In the Consul documentation, it shows hosts as optional though: https://www.consul.io/docs/connect/config-entries/ingress-gateway#hosts - Have confirmed with the Consul team that this is accurate.

Additionally, the ingress example on the website doesn't include hosts, so it errors.

Reproduction steps

Expected Result

Job with consul ingress gateway deployed successfully.

Actual Result

Error Consul Ingress Service requires one or more hosts when using HTTP protocol ")

Job file

ingress {
    tls {
        enabled = false
    }
    listener {
        port     = 8080
        protocol = "http"
        service {
            name  = "freshrss"
            # hosts = ["freshrss.ingress.consul"] - fails unless this line is added
        }
    }
}

mikenomitch avatar Jul 27 '21 20:07 mikenomitch