Skip to content

raffaelespazzoli/hystrix-kuberneters-instance-discovery

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

hystrix-kuberneters-instance-discovery

This library allows you to discover Hystrix data stream endpoints in a Kubernetes environment. Hystrix endpoints must be published as part of a Kubernetes service. Hystrix endpoints will be aggregated by Turbine and then can be visualized using the hystrix dashboard.

In order for this library to work you need to pass the following environment variables:

  • namespace: this is the namespace under which the service kubernetes runs.
  • selector_key: this is the key of the selector that will, be used to get the list of pods.
  • selector_value: this is the balue of the selector that will be used to get the list of pods.
  • hystrix_cluster_name: this is the name of the cluster under which turbine will publish the aggregated data. For example if you cluster name is bob, you'll be able to retrieve the data at http://<host_address>:<port>/kubernetes-hystrix-dashboard/turbine.stream?cluster=<cluster_name>

If you run this library inside a kubernetes cluster the fabric8 kuebernetes client should be able to initialize itself. if you're running this library outside a kubernetes cluster you will need to set additional environment variables in order to initialize the kuebernetes client as described here.

You'll need to create a web app with this library and initialize Netflix Turbine appropriately. To initialize the Kubernetes Hystrix instance discovery, please refer to the netflix turbine project. The discovery class name is com.raffa. KubernetesInstanceDiscovery.

If you don't need special initialization a simple initializer is provided. Just add the following to your web.xml:

 <listener>
		<listener-class>
             com.raffa.TurbineInitializer 
        </listener-class>       
 </listener>

I created a simple web app that includes turbine with this initialer and the hystrix dashboard. You can find the project here. I also created a container with the above web app deplyed on tomcat. The container can be found here. Here you can find sample yaml files needed to deploy the web app in kubernetes.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages