uber / kraken

P2P Docker registry capable of distributing TBs of data in seconds
Apache License 2.0
6.13k stars 422 forks source link

k8s: Running in an IPv6 dual stack cluster. #311

Open Vilsol opened 3 years ago

Vilsol commented 3 years ago

Describe the bug Currently if you are running in a dual-stack IPv4/6 cluster with emphasis on IPv6, kraken is unable to run.

The major issue resides here: https://github.com/uber/kraken/blob/master/lib/hostlist/config.go#L102

It resolves all peer instances of kraken via the headless DNS service, but if the DNS service returns at least (or only) IPv6 addresses, the entire startup errors due to it then being passed to the attachPortIfMissing here: https://github.com/uber/kraken/blob/master/lib/hostlist/config.go#L109

Filtering by IPv4 would only solve the issue if the DNS returns an IPv4 address, but in our case it does not. The only solution is then to actually support IPv6 at least in this function.

To Reproduce Steps to reproduce the behavior:

  1. Start up a dual-stack cluster
  2. Run kraken

Expected behavior Kraken to run

Environments k8s v1.21.3