github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/jobspec/test-fixtures/tg-network-with-hostname.hcl (about)

     1  job "foo" {
     2    datacenters = ["dc1"]
     3  
     4    group "bar" {
     5      count          = 3
     6      shutdown_delay = "14s"
     7  
     8      network {
     9        mode     = "bridge"
    10        hostname = "foobar"
    11  
    12        port "http" {
    13          static       = 80
    14          to           = 8080
    15          host_network = "public"
    16        }
    17      }
    18  
    19      task "bar" {
    20        driver = "raw_exec"
    21  
    22        config {
    23          command = "bash"
    24          args    = ["-c", "echo hi"]
    25        }
    26  
    27        resources {
    28          network {
    29            mbits = 10
    30          }
    31        }
    32      }
    33    }
    34  }