Skip to content

Consule "Services" list includes unhealthy services #73

@EugenMayer

Description

@EugenMayer

If we think about what is done with Consul and Tiller, we might agree that we will, somehow, generate configurations for each available service in consul and rigister it in a configuration file for some service like nginx / whatever as an upstream server - generating the configuration will be done by tiller.

No, with the current consul_services the health status is not respected, its just all available service, no matter if they answer or not. This collection, together with the use of a live registry like consul will then generated broken upstream services.

I cannot image a single usecase where this makes actual sense.

I would suggest, we either reimplement consul_services to include only health services or we introduce consul_services_healthy as an additional variable for that.

Pseudo code would be somewaht like

   consul_services_healthy = {}

   heathy_services = Diplomat::Health.state('passing')
   heathy_services.each{ |service| 
     service_data = Diplomat::Service.get(service['CheckID'])
     consul_services_healthy[service['CheckID']] = service_data
   }

what are your thoughts on this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions