levant icon indicating copy to clipboard operation
levant copied to clipboard

Levant Deployment Service Deployment: Update Stanza

Open stack72 opened this issue 6 years ago • 2 comments

Currently, when a service deployment happens, levant assumes that the Job will have the update stanza assigned to it

I currently use a template that looks like this:

job "tsg-v1" {
  type = "service"
  datacenters = ["us-east-1a"]
  group "deployment" {

    constraint {
      distinct_hosts = true
    }

    constraint {
      operator = "="
      attribute = "${meta.role}"
      value = "api-server"
    }

    update {
      health_check = "task_states"
      max_parallel = 1
      stagger      = "10s"
    }

Notice that the update stanza is in the group, therefore, the levant deployment throws the following info message:

2018/04/20 12:48:05 UTC [INFO] levant/deploy: job tsg-v1 is not configured with update stanza, consider adding to use deployments

This is because of the following code in levant:

// If the service job doesn't have an update stanza, the job will not use // Nomad deployments. if l.config.Job.Update == nil { logging.Info("levant/deploy: job %s is not configured with update stanza, consider adding to use deployments", *l.config.Job.Name) return l.jobStatusChecker(&eval.EvalID) }


Would you be happy to check for a group update stanza here as well?

stack72 avatar Apr 20 '18 14:04 stack72

hey @stack72 thanks for the issue and you're exactly right that the update stanza should be checked at both the job and group level; sorry about that.

jrasell avatar Apr 20 '18 14:04 jrasell

@jrasell sending a PR right now :)

stack72 avatar Apr 20 '18 14:04 stack72