hashicorp / nomad

Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations.
https://www.nomadproject.io/
Other
14.59k stars 1.92k forks source link

Ability for Consul to serve traffic despite an optional Health Check failure #23504

Open teeto11 opened 1 week ago

teeto11 commented 1 week ago

Proposal Hello it will be nice to have a way to configure health checks for certain services as optional , so when this service fails, the app still works on the failure of just that particular service. Does something like this exist and i may have missed it ?

Use-cases For example if a health check for a service is marked as not healthy on consul, i want to be able to still serve traffic to the app because that service isn't a major dependency to cause a restart.

teeto11 commented 1 week ago

Just like this issue but this should not stop consul from still serving the app

pkazmierczak commented 1 week ago

Hi @teeto11, you can set on_update field to ignore_warnings or ignore to instruct Nomad to treat the service as healthy regardless of its Consul status. Is that what you meant? let me know if this works for you.

teeto11 commented 1 week ago

@pkazmierczak I actually tried this but consul still registered the check i applied it on as critical and the app failed to start, hence this feedback, except i am doing something wrong. i think the flag only works for warning health status

pkazmierczak commented 1 week ago

right, so ignore_warnings is a Nomad setting, it will only affect how Nomad will proceed with service deployment. If you don't want the check to register on Consul as critical, you can use a script check type or perhaps set high values for failures_before_critical or timeout fields? Or disable the check altogether?

teeto11 commented 1 week ago

Thanks @pkazmierczak , where can i find the check type script

pkazmierczak commented 1 week ago

We have some examples in our documentation and there's more examples on Consul website