I have a weird one! We're moving to ipv6-only kube...
# pact-broker
r
I have a weird one! We're moving to ipv6-only kubernetes clusters. We're using https://github.com/pact-foundation/pact-broker-docker via the https://github.com/pact-foundation/pact-broker-chart. The container was failing to be reachable, because puma was only binding to the ipv4 port. We saw this by `kubectl exec`ing in and running `netstat -nl`:
Copy code
Proto Recv-Q Send-Q Local Address           Foreign Address         State
tcp        0      0 0.0.0.0:9292            0.0.0.0:*               LISTEN
This is resolved by modifying
entrypoint.sh
to read
bundle exec puma --bind 'tcp://[::]:9292'
(note:
--bind 'tcp://[::]' --port 9292
does NOT work.) Then we get:
Copy code
tcp        0      0 :::9292                 :::*                    LISTEN
and everything works. Ideally, I think puma should bind to both the ipv4 and ipv6 "any" addresses. I'm not sure why it isn't doing this by default. I'm posting here instead of making an issue because I'm not sure quite what the issue or real fix is, my networking is a bit rusty. However, as-is, the pact broker does not run in an ipv6-only kubernetes cluster, which I think should be fixed. I spent a few days on this and would like to save others the time.
🏆 1
m
It looks like it might relate to https://github.com/puma/puma/issues/782#issuecomment-233448657. Probably,
localhost
has an entry for
0.0.0.0
on your host, and was binding to the first address. It looks like if we set it to
localhost
it will bind to both interfaces. But that may have other consequences, so we’d need to review
probably it requires a tracking ticket so we can properly asses the impact, or provide documentation guidance on setting up ipv4 or ipv6 setups. Why hasn’t it been seen before? Probably because we (PactFlow) run it over a ipv4 stack, and noone else seems to be running it in the same way (or shared their learnings - thank you)
Would you mind creating an issue for us on the project repo?
r
You got it, on pact-broker-docker, or pact_broker?
m
Ooh. Start with the docker one please and we can move it around as needed
Thanks
r
thankyou 1
m
No probs, and thanks!