3.0 KiB
layout, page_title, sidebar_current, description
| layout | page_title | sidebar_current | description |
|---|---|---|---|
| docs | sidecar_service Stanza - Job Specification | docs-job-specification-sidecar-task | The "sidecar_task" stanza allows specifying options for configuring the task of the sidecar proxies used in Consul Connect integration |
sidecar_task Stanza
| Placement |
job -> group -> service -> connect -> **sidecar_task**
|
|---|
The sidecar_task stanza allows configuring various options for
the sidecar proxy managed by Nomad for Consul Connect integration.
It is valid only within the context of a connect stanza.
job "countdash" {
datacenters = ["dc1"]
group "api" {
network {
mode = "bridge"
}
service {
name = "count-api"
port = "9001"
connect {
sidecar_service {}
sidecar_task {
resources {
cpu = 500
memory = 1024
}
}
}
}
task "web" {
driver = "docker"
config {
image = "test/test:v1"
}
}
}
}
sidecar_task Parameters
-
name(string: )- Name of the task. -
driver(string: )- Driver used for the sidecar task. -
user(string:nil)- Determines which user is used to run the task, defaults to the same user the Nomad client is being run as. -
config(map:nil )- Configuration provided to the driver for initialization. -
env(map:nil )- Map of environment variables used by the driver. -
resourcesresources- Resources needed by this task. -
meta(map:nil )- Arbitary metadata associated with this task that's opaque to Nomad. -
logs(Logs: nil)- Specifies logging configuration for thestdoutandstderrof the task. -
kill_timeout(int:)- Time between signalling a task that will be killed and killing it. -
shutdown_delay(int:)- Delay between deregistering the task from Consul and sendint it a signal to shutdown. -
kill_signal(string:SIGINT)- Kill signal to use for the task, defaults to SIGINT.
sidecar_task Examples
The following example configures resources for the sidecar task and other configuration.
sidecar_task {
resources {
cpu = 500
memory = 1024
}
env {
FOO = "abc"
}
shutdown_delay = "5s"
}