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

     1  job "test1" {
     2    datacenters = ["dc1", "dc2"]
     3    type        = "service"
     4  
     5    constraint {
     6      attribute = "${attr.kernel.name}"
     7      value     = "linux"
     8    }
     9  
    10    group "test1" {
    11      count = 5
    12  
    13      affinity {
    14        attribute = "${node.datacenter}"
    15        operator  = "="
    16        value     = "dc1"
    17        weight    = 100
    18      }
    19  
    20      task "test" {
    21        driver = "raw_exec"
    22  
    23        config {
    24          command = "bash"
    25          args    = ["-c", "sleep 15000"]
    26        }
    27      }
    28    }
    29  }