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

     1  # Copyright (c) HashiCorp, Inc.
     2  # SPDX-License-Identifier: MPL-2.0
     3  
     4  job "service_discovery" {
     5    datacenters = ["dc1"]
     6    type        = "service"
     7  
     8    constraint {
     9      attribute = "${attr.kernel.name}"
    10      value     = "linux"
    11    }
    12  
    13    group "service_discovery" {
    14  
    15      service {
    16        name     = "http-api"
    17        provider = "consul"
    18        tags     = ["foo", "bar"]
    19      }
    20  
    21      task "test" {
    22        driver = "raw_exec"
    23  
    24        config {
    25          command = "bash"
    26          args    = ["-c", "sleep 15000"]
    27        }
    28      }
    29    }
    30  
    31    group "service_discovery_secondary" {
    32  
    33      service {
    34        name     = "http-api-nomad"
    35        provider = "nomad"
    36        tags     = ["foo", "bar"]
    37      }
    38  
    39      task "test" {
    40        driver = "raw_exec"
    41  
    42        config {
    43          command = "bash"
    44          args    = ["-c", "sleep 15000"]
    45        }
    46      }
    47    }
    48  }