Files
nomad/website/source/docs/job-specification/sidecar_task.html.md
2019-09-05 13:08:31 -05:00

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.

  • resources resources - 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 the stdout and stderr of 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"
   }