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

     1  job "checks_sad" {
     2    datacenters = ["dc1"]
     3    type        = "service"
     4  
     5    constraint {
     6      attribute = "${attr.kernel.name}"
     7      value     = "linux"
     8    }
     9  
    10    group "group" {
    11      network {
    12        mode = "host"
    13        port "http" {}
    14      }
    15  
    16      service {
    17        provider = "nomad"
    18        name     = "http-server"
    19        port     = "http"
    20        check {
    21          name     = "http-server-check"
    22          type     = "http"
    23          path     = "/"
    24          method   = "POST" # not allowed by http.server
    25          interval = "2s"
    26          timeout  = "1s"
    27        }
    28      }
    29  
    30      task "python-http" {
    31        driver = "raw_exec"
    32        config {
    33          command = "python3"
    34          args    = ["-m", "http.server", "${NOMAD_PORT_http}"]
    35        }
    36      }
    37    }
    38  }