Open ExalDraen opened 5 years ago
it's happen to me when i.m run job in Jenkins-in-docker in Jenkins-on-VM same levant and job+parameters works fine
so sad, now ned thing how inject parameters another way in levant process, or use another runner, or some else.
There is PR which based description fixed this #428
Description
Levant does not use the
region
specified inside a job spec to deploy the given job to the correct region (cf. docs for region key) Instead, the job is submitted to the default region, or the region specified by theNOMAD_REGION
environment variable if that is set.This behaviour is confusing and differs from the native nomad CLI. The native CLI will use the
region
specified in a job spec to choose the region to which a job will be submitted.See the docs for how
region
is meant to be interpreted.Bug Analysis
The native CLI explicitly configures the nomad client to use the region specified in the job file - e.g. see the code for
job run
: https://github.com/hashicorp/nomad/blob/master/command/job_run.go#L165In contrast,
levant
does not do this as far as I can see from the code. This results in the client not being configured with the correct region.Running tcpdump demonstrates this difference - note the difference in query parameters:
Relevant Nomad job specification file
Exact same as https://github.com/hashicorp/nomad-guides/blob/master/application-deployment/redis/redis.nomad but with
region
anddatacenter
set tous-central1
.Output of
levant version
:Output of
nomad version
:CLI executable:
Servers:
Debug log outputs from Levant:
Attempt to deploy to
us-central1
when default is another region - deployment stalls as no nodes in the other region have the correct region and datacenter set.