github.com/hernad/nomad@v1.6.112/e2e/connect/input/expose-custom.nomad (about)

     1  # Copyright (c) HashiCorp, Inc.
     2  # SPDX-License-Identifier: MPL-2.0
     3  
     4  job "expose-custom" {
     5    datacenters = ["dc1"]
     6  
     7    constraint {
     8      attribute = "${attr.kernel.name}"
     9      value     = "linux"
    10    }
    11  
    12    group "api" {
    13      network {
    14        mode = "bridge"
    15      }
    16  
    17      service {
    18        name = "count-api"
    19        port = "9001"
    20  
    21        connect {
    22          sidecar_service {}
    23          sidecar_task {
    24            resources {
    25              cpu    = 133
    26              memory = 63
    27            }
    28          }
    29        }
    30  
    31        check {
    32          expose   = true
    33          name     = "api-health"
    34          type     = "http"
    35          path     = "/health"
    36          interval = "10s"
    37          timeout  = "3s"
    38        }
    39      }
    40  
    41      task "web" {
    42        driver = "docker"
    43  
    44        config {
    45          image = "hashicorpdev/counter-api:v3"
    46        }
    47      }
    48    }
    49  }