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

     1  ---
     2  layout: docs
     3  page_title: sidecar_service Stanza - Job Specification
     4  sidebar_title: sidecar_service
     5  description: |-
     6    The "sidecar_service" stanza allows specifying options for configuring
     7    sidecar proxies used in Consul Connect integration
     8  ---
     9  
    10  # `sidecar_service` Stanza
    11  
    12  <Placement groups={['job', 'group', 'service', 'connect', 'sidecar_service']} />
    13  
    14  The `sidecar_service` stanza allows configuring various options for the sidecar
    15  proxy managed by Nomad for [Consul
    16  Connect](/docs/integrations/consul-connect) integration. It is
    17  valid only within the context of a connect stanza.
    18  
    19  ```hcl
    20  job "countdash" {
    21    datacenters = ["dc1"]
    22  
    23    group "api" {
    24      network {
    25        mode = "bridge"
    26      }
    27  
    28      service {
    29        name = "count-api"
    30        port = "9001"
    31  
    32        connect {
    33          sidecar_service {}
    34        }
    35      }
    36  
    37      task "web" {
    38        driver = "docker"
    39  
    40        config {
    41          image = "hashicorpnomad/counter-api:v2"
    42        }
    43      }
    44    }
    45  }
    46  ```
    47  
    48  ## `sidecar_service` Parameters
    49  
    50  - `tags` <code>(array&lt;string&gt;: nil)</code> - Custom Consul service tags for the sidecar service.
    51  
    52  - `port` `(string: )` - Port label for sidecar service.
    53  
    54  - `proxy` <code>([proxy][]: nil)</code> - This is used to configure the sidecar proxy service.
    55  
    56  ## `sidecar_service` Examples
    57  
    58  The following example is a minimal `sidecar_service` stanza with defaults
    59  
    60  ```hcl
    61    connect {
    62      sidecar_service {}
    63    }
    64  ```
    65  
    66  The following example includes specifying upstreams.
    67  
    68  ```hcl
    69     sidecar_service {
    70       proxy {
    71         upstreams {
    72           destination_name = "count-api"
    73           local_bind_port = 8080
    74         }
    75       }
    76     }
    77  
    78  ```
    79  
    80  [job]: /docs/job-specification/job 'Nomad job Job Specification'
    81  [group]: /docs/job-specification/group 'Nomad group Job Specification'
    82  [task]: /docs/job-specification/task 'Nomad task Job Specification'
    83  [interpolation]: /docs/runtime/interpolation 'Nomad interpolation'
    84  [sidecar_service]: /docs/job-specification/sidecar_service 'Nomad sidecar service Specification'
    85  [proxy]: /docs/job-specification/proxy 'Nomad sidecar proxy config Specification'