yammer / breakerbox

Frontend for Tenacity + Archaius
Apache License 2.0
63 stars 29 forks source link

Instance discovery in Kubernetes clusters #21

Closed mlamina closed 8 years ago

mlamina commented 8 years ago

I created a class which will detect Kubernetes pods that are annotated with 'breakerbox-port'. This has two advantages:

  1. The user can tell breakerbox which pods are running a breakerbox-enabled service
  2. The user can define which port the turbine endpoints are running on

It will cluster the instances with a combination of the namespace and the pod's base name and use the pod's IP address as the host name. However, I am unsure how to properly integrate it into the breakerbox service without breaking existing configurations.

chrisgray commented 8 years ago

This is great thanks @mlamina !

I agree and I was thinking the same thing how we are can start allowing custom configuration and choice on how to do InstanceDiscovery. At the moment it feels pretty clunky to have to build a custom build in order to register your own InstanceDiscovery mechanism.

The way that Turbine does it at the moment is via reflection and you just specify your InstanceDiscovery class by a System.property. Perhaps we can do something similar with Breakerbox, but more Dropwizard style. If you have any thoughts feel free to submit them :-)