hashicorp / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
28.31k stars 4.42k forks source link

Store both IPv4 and IPv6 addresses for Docker services #15902

Open agibson-bluecat opened 1 year ago

agibson-bluecat commented 1 year ago

Our team runs several docker containers as nomad tasks (registered as services with Consul), and we need access to the containers' IPv4 and IPv6 addresses in a consul template. We use Docker bridge networking for our containers, and have the following daemon.json settings to enable IPv6 networking for containers:

{
  "ipv6" : true,
  "fixed-cidr-v6": "fd00::/80"
}

We've noticed that the addresses registered for these services in Consul are either only IPv4, or only IPv6 (if we set advertise_ipv6_address in the task configuration):

Because Consul only ever stores either the IPv4 or IPv6 address, it seems like there is no way to get access to both addresses by pulling fields out of the service object in our templates. Would the Consul team be open to auto-populating both the _ipv4 and _ipv6 tagged addresses for docker container services, if the container has both types of addresses?

enspritz commented 1 year ago

We need this too! Hoping this will be scheduled for release --