github.com/hernad/nomad@v1.6.112/e2e/events/input/deploy.nomad (about)

     1  # Copyright (c) HashiCorp, Inc.
     2  # SPDX-License-Identifier: MPL-2.0
     3  
     4  job "deployment_auto.nomad" {
     5    datacenters = ["dc1", "dc2"]
     6  
     7    constraint {
     8      attribute = "${attr.kernel.name}"
     9      value     = "linux"
    10    }
    11  
    12    group "one" {
    13      count = 3
    14  
    15      update {
    16        max_parallel     = 3
    17        auto_promote     = true
    18        canary           = 2
    19        min_healthy_time = "1s"
    20      }
    21  
    22      network {
    23        port "db" {
    24          to = 1234
    25        }
    26      }
    27  
    28      task "one" {
    29        driver = "docker"
    30  
    31        env {
    32          version = "1"
    33        }
    34  
    35        config {
    36          image   = "busybox:1"
    37          command = "nc"
    38          args    = ["-ll", "-p", "1234", "-e", "/bin/cat"]
    39          ports   = ["db"]
    40        }
    41  
    42        resources {
    43          cpu    = 20
    44          memory = 20
    45        }
    46      }
    47    }
    48  }