-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support custom address broadcasting for ringpop to work in k8s #6288
Support custom address broadcasting for ringpop to work in k8s #6288
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files
... and 4 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
Is there any kind of K8s concept of hostname that can be used to refer to the instance rather than introducing an awareness of the container's own hostport/ip? I'm not sure this would work in mesh-networks (Not that I have any experience with them)? also, why do we need to bind on 0.0.0.0? Wouldn't binding on the same IP as what's exposed work? |
This setup is more typical in K8s. Binding on 0.0.0.0 makes it easier to serve requests targeted to IPs/dns etc. Also makes it possible to port-forward for debugging. |
f473e25
to
d864fd1
Compare
What changed?
Current ringpop initialization is making it difficult to run ringpop in K8s like environments. Ringpop is initialized with the address that the service instance (container) is going to listen on and it gets advertised to peers. This is problematic because listen address of replicas are not unique and cannot be used to communicate peer to peer.
Local listen address (BIND_ON_IP) should be set to 0.0.0.0 and the pod's ip address (10.x.y.z) should be used to join the ring for p2p. Pod's IP address is accessible by other pods in the k8s cluster.
This PR introduces
ringpop.broadcastAddress
config which will make ringpop work in k8s environments.For example:
History-service-container-replica-1:
listens and serves on
0.0.0.0:7934
broadcasts itself to peers as
10.66.1.71
(its own pod ip)History-service-container-replica-2:
listens and serves on
0.0.0.0:7934
broadcasts itself to peers as
10.66.1.75
(its own pod ip)A headless k8s service can be used for discovery which will return list of pod ips
10.x.y.z
.This can be achieved on K8s by passing pod's IP address as an env variable.
Ringpop config would look like this:
Other misc changes:
How did you test it?