github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/e2e/spread/input/multiple_spread.nomad (about)

     1  job "r1" {
     2    datacenters = ["dc1", "dc2"]
     3    type        = "service"
     4  
     5    constraint {
     6      attribute = "${attr.kernel.name}"
     7      value     = "linux"
     8    }
     9  
    10    spread {
    11      attribute = "${node.datacenter}"
    12      weight    = 100
    13    }
    14  
    15    group "test1" {
    16      count = 10
    17  
    18      spread {
    19        attribute = "${meta.rack}"
    20        weight    = 100
    21  
    22        target "r1" {
    23          percent = 70
    24        }
    25  
    26        target "r2" {
    27          percent = 30
    28        }
    29      }
    30  
    31      task "test" {
    32        driver = "raw_exec"
    33  
    34        config {
    35          command = "bash"
    36          args    = ["-c", "sleep 15000"]
    37        }
    38      }
    39    }
    40  }