Merge pull request #5324 from hashicorp/f-nomad-init
expand job init example with spread and affinity
This commit is contained in:
commit
95edd4a97b
|
@ -340,6 +340,52 @@ job "example" {
|
|||
size = 300
|
||||
}
|
||||
|
||||
|
||||
# The "affinity" stanza enables operators to express placement preferences
|
||||
# based on node attributes or metadata.
|
||||
#
|
||||
# For more information and examples on the "affinity" stanza, please
|
||||
# see the online documentation at:
|
||||
#
|
||||
# https://www.nomadproject.io/docs/job-specification/affinity.html
|
||||
#
|
||||
# affinity {
|
||||
# attribute specifies the name of a node attribute or metadata
|
||||
# attribute = "${node.datacenter}"
|
||||
|
||||
# value specifies the desired attribute value. In this example Nomad
|
||||
# will prefer placement in the "us-west1" datacenter.
|
||||
# value = "us-west1"
|
||||
|
||||
# weight can be used to indicate relative preference
|
||||
# when the job has more than one affinity. It defaults to 50 if not set.
|
||||
# weight = 100
|
||||
# }
|
||||
|
||||
# The "spread" stanza allows operators to increase the failure tolerance of
|
||||
# their applications by specifying a node attribute that allocations
|
||||
# should be spread over.
|
||||
#
|
||||
# For more information and examples on the "spread" stanza, please
|
||||
# see the online documentation at:
|
||||
#
|
||||
# https://www.nomadproject.io/docs/job-specification/spread.html
|
||||
#
|
||||
# spread {
|
||||
# attribute specifies the name of a node attribute or metadata
|
||||
# attribute = "${node.datacenter}"
|
||||
|
||||
# targets can be used to define desired percentages of allocations
|
||||
# for each targeted attribute value.
|
||||
#
|
||||
# target "us-east1" {
|
||||
# percent = 60
|
||||
# }
|
||||
# target "us-west1" {
|
||||
# percent = 40
|
||||
# }
|
||||
# }
|
||||
|
||||
# The "task" stanza creates an individual unit of work, such as a Docker
|
||||
# container, web application, or batch processing.
|
||||
#
|
||||
|
|
Loading…
Reference in a new issue