Nomad: Flag to wait till deployment actually succeeded

Created on 21 Aug 2018  路  10Comments  路  Source: hashicorp/nomad

Hello there! Question here.

It would be really great if i could run nomad run and it won't release terminal till deployment is not only scheduled, but also completed successfully.

Use case:

  • all deployments are being run from CI
  • template nomad job against some environment via consul-template
  • or template nomad job via terraform (template_file)
  • plan/run template to deploy stuff
  • terminal gets released if constrains/capacity are OK
  • run script to check whenever deployment is successful by getting desiredCount and comparing to healthyCount in a loop

This approach is sub-optimal since it relies on some scripting which can be faulty and may have some corner cases.

Can we add flag to nomad run so it won't throw 0 exit code till deployment is finished?
Same would be awesome for nomad provider for terraform.

Thanks for attention in advance!

stagaccepted themcli typenhancement

Most helpful comment

@yellowmegaman : FYI, i'm adding this feature to the Nomad TF provider:
https://github.com/terraform-providers/terraform-provider-nomad/issues/56

All 10 comments

a work-around for now is to use jrasell/levant

@jippi thanks! seen it before, never had a chance to use it yet.

In my opinion it's not something that should be external to nomad, since it is already aware of the state of deployed services.

Anyway, gonna try levant for now, leaving issue open in case there would be some update whenever feature may land on roadmap for some future release.

Yes, I'm pretty sure Nomad will eventually support this - should be pretty trivial to add - just wanted to unblock you until Nomad got native support :)

@jippi in that you've succeeded =) Thank again

Well, levant seems to be completely broken, deploying nomad job with broken on purpose healthcheck results in success, so hope this issue will see some attention someday.

@yellowmegaman feel free to raise an issue against Levant and I can take a look into it. We use it extensively and successfully in my current job so I would be curious what the issue is.

@yellowmegaman I do think it is a good feature and would want to add it. @jrasell PRs welcome 馃槃

@dadgar that is super-awesome =)
@jippi https://github.com/jrasell/levant/issues/227

@yellowmegaman : FYI, i'm adding this feature to the Nomad TF provider:
https://github.com/terraform-providers/terraform-provider-nomad/issues/56

Looks like levant is abandoned by owner. Thus the flag in Nomad would be super useful for us too.

Was this page helpful?
0 / 5 - 0 ratings