Open mr-karan opened 1 year ago
Hi @mr-karan and thanks for raising, what I agree, would be a useful addition to the Nomad service discovery feature. To provide context, this is a known and designed current limitation as the health check state is only stored on the Nomad client that is performing the checking.
Nomad newbie here, this peculiarity should definitely be mentioned in the template
docs. I thought it is obvious that only healthy service instances are included in nomadService
and wasted hours searching the cause of my problems.
Proposal
Currently, I am querying the list of Nomad Services using consul-template Nomad functions. I couldn't find a way to filter only the list of healthy services.
However, when I query the list of nomad services for this namespace, I can find these services here and it doesn't have any metadata whether the healthcheck failed or not:
Use-cases
When using NGINX or similar proxy, it's useful to only filter the upstream servers which are healthy. This will help these proxies to not send the request to the upstream servers where health checks are failing.
Attempted Solutions
Couldn't find a workaround