Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
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):
when I curl Consul's /v1/agent/services endpoint, I see that if advertise_ipv6_address is enabled for the service then the Address field is the container's IPv6 address and the only automatically-populated tagged addresses are lan_ipv6 and wan_ipv6
otherwise the Address is the container's IPv4 address and we only get lan_ipv4 and wan_ipv4
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?
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: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):
/v1/agent/services
endpoint, I see that ifadvertise_ipv6_address
is enabled for the service then theAddress
field is the container's IPv6 address and the only automatically-populated tagged addresses arelan_ipv6
andwan_ipv6
Address
is the container's IPv4 address and we only getlan_ipv4
andwan_ipv4
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?