hashicorp / hashicorp/consul

DNS for Consul Connect ingress port is wrong

Open
#8,325 1 comment 1 reaction 0 assignees View on GitHub
theme/dns theme/ingress-gw
Dominant language
Go
Stars
30.1k
Forks
4.6k
Avg merge
2d 6h
Merged PRs (30d)
43

Description

#### Overview of the Issue

The DNS response for Consul Connect ingress ports shows the wrong port. This makes it impossible to resolve the actual host/port for my public facing haproxy instance.

#### Reproduction Steps

Given this ingress configuration:

```
Kind = "ingress-gateway"
Name = "eu-central-1-ingress"

TLS {
Enabled = true
}

Listeners = [
{
Port = 8080
Protocol = "http"
Services = [
{
Name = "web"
}
]
}
]
```

Leads to this result:

```
dig SRV web.ingress.consul

;; ANSWER SECTION:
web.ingress.consul. 0 IN SRV 1 1 7777 0a00000a.addr.eu-central-1.consul.

;; ADDITIONAL SECTION:
0a00000a.addr.eu-central-1.consul. 0 IN A 10.0.0.10
core-1.node.eu-central-1.consul. 0 IN TXT "consul-network-segment="
```

The port the DNS lookup returns is `7777`, and if you try to `curl -v http://web.ingress.consul:7777` you'll be treated to a `404` response.

The reason for `7777` to show up at all seems to be that Envoy is started using this command:

```
consul connect envoy \
-gateway ingress \
-register \
-service eu-central-1-ingress \
-address '{{ GetInterfaceIP "ens5" }}:7777'
```

### Consul info for both Client and Server

Client info

```
agent:
check_monitors = 0
check_ttls = 2
checks = 6
services = 6
build:
prerelease =
revision =
version = 1.8.0
consul:
acl = enabled
bootstrap = false
known_datacenters = 1
leader = false
leader_addr = 10.0.32.10:8300
server = true
raft:
applied_index = 389290
commit_index = 389290
fsm_pending = 0
last_contact = 15.142592ms
last_log_index = 389290
last_log_term = 12
last_snapshot_index = 383400
last_snapshot_term = 12
latest_configuration = [{Suffrage:Voter ID:2ac37785-9f4c-c3fe-59f5-e3a5a05303c4 Address:10.0.64.10:8300} {Suffrage:Voter ID:d41125ac-549e-55ac-8b63-aa83f1774727 Address:10.0.32.10:8300} {Suffrage:Voter ID:a7979dca-536d-cd17-6720-2931e99818e3 Address:10.0.0.10:8300}]
latest_configuration_index = 0
num_peers = 2
protocol_version = 3
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Follower
term = 12
runtime:
arch = amd64
cpu_count = 2
goroutines = 234
max_procs = 2
os = linux
version = go1.14.4
serf_lan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 11
failed = 0
health_score = 0
intent_queue = 0
left = 1
member_time = 56
members = 6
query_queue = 0
query_time = 1
serf_wan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 10
members = 3
query_queue = 0
query_time = 1
```

Server info

```
agent:
check_monitors = 0
check_ttls = 2
checks = 6
services = 6
build:
prerelease =
revision =
version = 1.8.0
consul:
acl = enabled
bootstrap = false
known_datacenters = 1
leader = false
leader_addr = 10.0.32.10:8300
server = true
raft:
applied_index = 389290
commit_index = 389290
fsm_pending = 0
last_contact = 15.142592ms
last_log_index = 389290
last_log_term = 12
last_snapshot_index = 383400
last_snapshot_term = 12
latest_configuration = [{Suffrage:Voter ID:2ac37785-9f4c-c3fe-59f5-e3a5a05303c4 Address:10.0.64.10:8300} {Suffrage:Voter ID:d41125ac-549e-55ac-8b63-aa83f1774727 Address:10.0.32.10:8300} {Suffrage:Voter ID:a7979dca-536d-cd17-6720-2931e99818e3 Address:10.0.0.10:8300}]
latest_configuration_index = 0
num_peers = 2
protocol_version = 3
protocol_version_max = 3
protocol_version_min = 0
snapshot_version_max = 1
snapshot_version_min = 0
state = Follower
term = 12
runtime:
arch = amd64
cpu_count = 2
goroutines = 234
max_procs = 2
os = linux
version = go1.14.4
serf_lan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 11
failed = 0
health_score = 0
intent_queue = 0
left = 1
member_time = 56
members = 6
query_queue = 0
query_time = 1
serf_wan:
coordinate_resets = 0
encrypted = true
event_queue = 0
event_time = 1
failed = 0
health_score = 0
intent_queue = 0
left = 0
member_time = 10
members = 3
query_queue = 0
query_time = 1
```

### Operating system and Environment details

NixOS 20.03 on x86_64. Envoy is version `1.14.3`.

### Log Fragments

The Nomad service I run behind the Envoy ingress is: https://gist.github.com/manveru/3e4fc3644e261977f06234a25c7da65e

Also tagging @apollo13 since he was interested in this.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.