github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/e2e/nodedrain/input/drain_deadline.nomad (about)

     1  job "drain_deadline" {
     2    datacenters = ["dc1", "dc2"]
     3  
     4    constraint {
     5      attribute = "${attr.kernel.name}"
     6      value     = "linux"
     7    }
     8  
     9    group "group" {
    10  
    11      task "task" {
    12        driver = "docker"
    13  
    14        kill_timeout = "2m"
    15  
    16        config {
    17          image   = "busybox:1"
    18          command = "/bin/sh"
    19          args    = ["local/script.sh"]
    20        }
    21  
    22        template {
    23          data = <<EOF
    24  #!/bin/sh
    25  trap 'sleep 60' 2
    26  sleep 600
    27  EOF
    28  
    29          destination = "local/script.sh"
    30          change_mode = "noop"
    31        }
    32  
    33        resources {
    34          cpu    = 256
    35          memory = 128
    36        }
    37      }
    38    }
    39  }