github.com/hernad/nomad@v1.6.112/e2e/servicediscovery/input/checks_sad.nomad (about)

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