open-nomad/website/content/docs/job-specification/sidecar_service.mdx

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

90 lines
2.1 KiB
Plaintext
Raw Normal View History

2019-09-05 18:08:31 +00:00
---
2020-02-06 23:45:31 +00:00
layout: docs
page_title: sidecar_service Block - Job Specification
2019-09-05 18:08:31 +00:00
description: |-
The "sidecar_service" block allows specifying options for configuring
2019-09-05 18:08:31 +00:00
sidecar proxies used in Consul Connect integration
---
# `sidecar_service` Block
2019-09-05 18:08:31 +00:00
2020-02-06 23:45:31 +00:00
<Placement groups={['job', 'group', 'service', 'connect', 'sidecar_service']} />
2019-09-05 18:08:31 +00:00
The `sidecar_service` block allows configuring various options for the sidecar
proxy managed by Nomad for [Consul
Connect](/nomad/docs/integrations/consul-connect) integration. It is
valid only within the context of a connect block.
2019-09-05 18:08:31 +00:00
```hcl
job "countdash" {
datacenters = ["dc1"]
group "api" {
network {
mode = "bridge"
}
service {
name = "count-api"
port = "9001"
connect {
sidecar_service {}
}
}
task "web" {
driver = "docker"
config {
image = "hashicorpdev/counter-api:v3"
}
}
}
}
2019-09-05 18:08:31 +00:00
```
## `sidecar_service` Parameters
- `disable_default_tcp_check` `(bool: false)` - disable the default TCP health
check.
2019-09-05 18:08:31 +00:00
- `port` `(string: )` - Port label for sidecar service.
- `proxy` <code>([proxy][]: nil)</code> - This is used to configure the
sidecar proxy service.
- `tags` <code>(array&lt;string&gt;: nil)</code> - Custom Consul service tags
for the sidecar service.
2019-09-05 18:08:31 +00:00
## `sidecar_service` Examples
The following example is a minimal `sidecar_service` block with defaults
2019-09-05 18:08:31 +00:00
```hcl
connect {
sidecar_service {}
}
```
The following example includes specifying upstreams.
```hcl
sidecar_service {
proxy {
upstreams {
destination_name = "count-api"
local_bind_port = 8080
}
}
}
2020-02-06 23:45:31 +00:00
```
2019-09-05 18:08:31 +00:00
[job]: /nomad/docs/job-specification/job 'Nomad job Job Specification'
[group]: /nomad/docs/job-specification/group 'Nomad group Job Specification'
[task]: /nomad/docs/job-specification/task 'Nomad task Job Specification'
[interpolation]: /nomad/docs/runtime/interpolation 'Nomad interpolation'
[sidecar_service]: /nomad/docs/job-specification/sidecar_service 'Nomad sidecar service Specification'
[proxy]: /nomad/docs/job-specification/proxy 'Nomad sidecar proxy config Specification'