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

     1  # Copyright (c) HashiCorp, Inc.
     2  # SPDX-License-Identifier: MPL-2.0
     3  
     4  job "checks_happy" {
     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          interval = "2s"
    28          timeout  = "1s"
    29        }
    30      }
    31  
    32      task "python-http" {
    33        driver = "raw_exec"
    34        config {
    35          command = "python3"
    36          args    = ["-m", "http.server", "${NOMAD_PORT_http}"]
    37        }
    38      }
    39    }
    40  }