github.com/iqoqo/nomad@v0.11.3-0.20200911112621-d7021c74d101/website/pages/docs/job-specification/proxy.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: proxy Stanza - Job Specification
     4  sidebar_title: proxy
     5  description: |-
     6    The "proxy" stanza allows specifying options for configuring
     7    sidecar proxies used in Consul Connect integration
     8  ---
     9  
    10  # `proxy` Stanza
    11  
    12  <Placement
    13    groups={['job', 'group', 'service', 'connect', 'sidecar_service', 'proxy']}
    14  />
    15  
    16  The `proxy` stanza allows configuring various options for the sidecar proxy
    17  managed by Nomad for [Consul
    18  Connect](/docs/integrations/consul-connect). It is valid only
    19  within the context of a `sidecar_service` stanza.
    20  
    21  ```hcl
    22  job "countdash" {
    23    datacenters = ["dc1"]
    24  
    25    group "api" {
    26      network {
    27        mode = "bridge"
    28      }
    29  
    30      service {
    31        name = "count-api"
    32        port = "9001"
    33  
    34        connect {
    35          sidecar_service {
    36            proxy {}
    37          }
    38        }
    39      }
    40  
    41      task "web" {
    42        driver = "docker"
    43  
    44        config {
    45          image = "hashicorpnomad/counter-api:v2"
    46        }
    47      }
    48    }
    49  }
    50  ```
    51  
    52  ## `proxy` Parameters
    53  
    54  - `local_service_address` `(string: "127.0.0.1")` - The address the local service binds to. Useful to
    55    customize in clusters with mixed Connect and non-Connect services.
    56  - `local_service_port` `(int:[port][])` - The port the local service binds to.
    57    Usually the same as the parent service's port, it is useful to customize in clusters with mixed
    58    Connect and non-Connect services
    59  - `upstreams` <code>([upstreams][]: nil)</code> - Used to configure details of each upstream service that
    60    this sidecar proxy communicates with.
    61  - `expose` <code>([expose]: nil)</code> - Used to configure expose path configuration for Envoy.
    62    See Consul's [Expose Paths Configuration Reference](https://www.consul.io/docs/connect/registration/service-registration.html#expose-paths-configuration-reference)
    63    for more information.
    64  - `config` `(map: nil)` - Proxy configuration that's opaque to Nomad and
    65    passed directly to Consul. See [Consul Connect's
    66    documentation](https://www.consul.io/docs/connect/proxies/envoy.html#dynamic-configuration)
    67    for details.
    68  
    69  ## `proxy` Examples
    70  
    71  The following example is a proxy specification that includes upstreams configuration.
    72  
    73  ```hcl
    74  sidecar_service {
    75    proxy {
    76      upstreams {
    77        destination_name = "count-api"
    78        local_bind_port  = 8080
    79      }
    80    }
    81  }
    82  ```
    83  
    84  [job]: /docs/job-specification/job 'Nomad job Job Specification'
    85  [group]: /docs/job-specification/group 'Nomad group Job Specification'
    86  [task]: /docs/job-specification/task 'Nomad task Job Specification'
    87  [interpolation]: /docs/runtime/interpolation 'Nomad interpolation'
    88  [sidecar_service]: /docs/job-specification/sidecar_service 'Nomad sidecar service Specification'
    89  [upstreams]: /docs/job-specification/upstreams 'Nomad upstream config Specification'
    90  [port]: /docs/job-specification/network#port-parameters 'Nomad network port configuration'
    91  [expose]: /docs/job-specification/expose 'Nomad proxy expose configuration'