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

     1  job "countdash" {
     2    datacenters = ["dc1"]
     3  
     4    constraint {
     5      attribute = "${attr.kernel.name}"
     6      value     = "linux"
     7    }
     8  
     9    group "api" {
    10      network {
    11        mode = "bridge"
    12      }
    13  
    14      service {
    15        name = "count-api"
    16        port = "9001"
    17  
    18        connect {
    19          sidecar_service {}
    20        }
    21  
    22        check {
    23          expose   = true
    24          name     = "api-health"
    25          type     = "http"
    26          path     = "/health"
    27          interval = "5s"
    28          timeout  = "3s"
    29        }
    30      }
    31  
    32      task "web" {
    33        driver = "docker"
    34  
    35        config {
    36          image = "hashicorpnomad/counter-api:v2"
    37        }
    38      }
    39    }
    40  
    41    group "dashboard" {
    42      network {
    43        mode = "bridge"
    44  
    45        port "http" {
    46          static = 9002
    47          to     = 9002
    48        }
    49      }
    50  
    51      service {
    52        name = "count-dashboard"
    53        port = "9002"
    54  
    55        connect {
    56          sidecar_service {
    57            proxy {
    58              upstreams {
    59                destination_name = "count-api"
    60                local_bind_port  = 8080
    61              }
    62            }
    63          }
    64        }
    65      }
    66  
    67      task "dashboard" {
    68        driver = "docker"
    69  
    70        env {
    71          COUNTING_SERVICE_URL = "http://${NOMAD_UPSTREAM_ADDR_count_api}"
    72        }
    73  
    74        config {
    75          image = "hashicorpnomad/counter-dashboard:v2"
    76        }
    77      }
    78    }
    79  }