hashicorp / levant

An open source templating and deployment tool for HashiCorp Nomad jobs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

levant deploy fails with "invalid key: volume"

kmandalas opened this issue · comments

Description

Cannot deploy job with "volume" Stanza defined

Relevant Nomad job specification file

job "document-ci" {

  datacenters = ["[[.dc]]"]

  type = "service"

  update { // rolling updates, one instance at a time
    max_parallel = 1
    health_check     = "task_states"
  }

  group "document-service" {
    volume "tpd" {
      type      = "host"
      read_only = false
      source    = "tpd"
    }
    count = [[.instances]]

    task "api" {
      driver = "java"
      config {
        jvm_options = ["-Xmx512m", "-Xms128m", "-Dspring.profiles.active=alpha"]
        jar_path    = "local/document-1.0.0-[[.version]].jar"
      }
      volume_mount {
        volume      = "tpd"
        destination = "/tpd"
        read_only   = false
      }
      artifact {
        source = "[[.artifactory]]/ktp/gr/tpd/services/document/1.0.0-[[.version]]/document-1.0.0-[[.version]].jar"
      }
      resources {
        cpu    = [[.cpu]]
        memory = [[.memory]]
        network {
          port "http" {}
        }
      }
    }
    restart {
      attempts = 1
      delay    = "10s"
      interval = "10m"
      mode     = "fail"
    }
  }

}

Output of levant version:

Levant v0.2.9
Date: 2019-12-27T09:43:30Z
Commit: 0f1913ea3d77584ddd0696da429dcf05572a73a0
Branch: 0.2.9
State: 0.2.9
Summary: 0f1913ea3d77584ddd0696da429dcf05572a73a0

Output of nomad version:

Nomad v1.0.1 (c9c68aa55a7275f22d2338f2df53e67ebfcb9238)

Additional environment details:

Debug log outputs from Levant:

[ERROR] levant/command: error parsing 'job': 1 error occurred:
* group: 'document-service' -> invalid key: volume

I realized that this was due to my levant version. I upgraded to 0.3.0 and the issue was resolved.