Merge pull request #6688 from hashicorp/docs-fix-constraint-link

[docs] Fix link; discuss meta; lint fixes
This commit is contained in:
Charlie Voiselle 2019-11-13 09:34:42 -05:00 committed by GitHub
commit 637a0c003e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 10 deletions

View File

@ -64,7 +64,7 @@ driver) but will be removed in a future release.
- `network_interface` `(string: varied)` - Specifies the name of the interface - `network_interface` `(string: varied)` - Specifies the name of the interface
to force network fingerprinting on. When run in dev mode, this defaults to the to force network fingerprinting on. When run in dev mode, this defaults to the
loopback interface. When not in dev mode, the interface attached to the loopback interface. When not in dev mode, the interface attached to the
default route is used. The scheduler chooses from these fingerprinted IP default route is used. The scheduler chooses from these fingerprinted IP
addresses when allocating ports for tasks. addresses when allocating ports for tasks.
If no non-local IP addresses are found, Nomad could fingerprint link-local IPv6 If no non-local IP addresses are found, Nomad could fingerprint link-local IPv6
@ -152,12 +152,12 @@ driver) but will be removed in a future release.
which the client will use to allocate IP addresses from. which the client will use to allocate IP addresses from.
- `template` <code>([Template](#template-parameters): nil)</code> - Specifies - `template` <code>([Template](#template-parameters): nil)</code> - Specifies
controls on the behavior of task [`template`](/docs/job-specification/template.html) stanzas. controls on the behavior of task
[`template`](/docs/job-specification/template.html) stanzas.
- `host_volume` <code>([host_volume](#host_volume-stanza): nil)</code> - Exposes - `host_volume` <code>([host_volume](#host_volume-stanza): nil)</code> - Exposes
paths from the host as volumes that can be mounted into jobs. paths from the host as volumes that can be mounted into jobs.
### `chroot_env` Parameters ### `chroot_env` Parameters
Drivers based on [isolated fork/exec](/docs/drivers/exec.html) implement file Drivers based on [isolated fork/exec](/docs/drivers/exec.html) implement file
@ -340,7 +340,6 @@ see the [drivers documentation](/docs/drivers/index.html).
reserve on all fingerprinted network devices. Ranges can be specified by using reserve on all fingerprinted network devices. Ranges can be specified by using
a hyphen separated the two inclusive ends. a hyphen separated the two inclusive ends.
### `template` Parameters ### `template` Parameters
- `function_blacklist` `([]string: ["plugin"])` - Specifies a list of template - `function_blacklist` `([]string: ["plugin"])` - Specifies a list of template
@ -356,7 +355,7 @@ see the [drivers documentation](/docs/drivers/index.html).
The `host_volume` stanza is used to make volumes available to jobs. The `host_volume` stanza is used to make volumes available to jobs.
The key of the stanza corresponds to the name of the volume for use in the The key of the stanza corresponds to the name of the volume for use in the
`source` parameter of a `"host"` type [`volume`](/docs/job-specification/volume.html) `source` parameter of a `"host"` type [`volume`](/docs/job-specification/volume.html)
and ACLs. and ACLs.
@ -418,7 +417,9 @@ client {
### Custom Metadata, Network Speed, and Node Class ### Custom Metadata, Network Speed, and Node Class
This example shows a client configuration which customizes the metadata, network This example shows a client configuration which customizes the metadata, network
speed, and node class. speed, and node class. The scheduler can use this information while processing
[constraints][metadata_constraint]. The metadata is completely user configurable;
the values below are for illustrative purposes only.
```hcl ```hcl
client { client {
@ -428,9 +429,13 @@ client {
meta { meta {
"owner" = "ops" "owner" = "ops"
"cached_binaries" = "redis,apache,nginx,jq,cypress,nodejs"
"rack" = "rack-12-1"
} }
} }
``` ```
[plugin-options]: #plugin-options [plugin-options]: #plugin-options
[plugin-stanza]: /docs/configuration/plugin.html [plugin-stanza]: /docs/configuration/plugin.html
[server-join]: /docs/configuration/server_join.html "Server Join" [server-join]: /docs/configuration/server_join.html "Server Join"
[metadata_constraint]: /docs/job-specification/constraint.html#user-specified-metadata "Nomad User-Specified Metadata Constraint Example"

View File

@ -138,7 +138,7 @@ constraint {
must be 1 or greater and if omitted, defaults to 1. When specified as a job must be 1 or greater and if omitted, defaults to 1. When specified as a job
constraint, it applies to all groups in the job. When specified as a group constraint, it applies to all groups in the job. When specified as a group
constraint, the effect is constrained to that group. This constraint can not constraint, the effect is constrained to that group. This constraint can not
be specified at the task level. be specified at the task level.
```hcl ```hcl
constraint { constraint {
@ -203,7 +203,7 @@ constraint {
before checking for equality. The default behavior for `"!="` is to include before checking for equality. The default behavior for `"!="` is to include
nodes that don't have that attribute set. nodes that don't have that attribute set.
- `"is_not_set"` - Specifies that a given attribute must not be present. - `"is_not_set"` - Specifies that a given attribute must not be present.
## `constraint` Examples ## `constraint` Examples
@ -227,7 +227,7 @@ constraint {
A potential use case of the `distinct_property` constraint is to spread a A potential use case of the `distinct_property` constraint is to spread a
service with `count > 1` across racks to minimize correlated failure. Nodes can service with `count > 1` across racks to minimize correlated failure. Nodes can
be annotated with which rack they are on using [client be annotated with which rack they are on using [custom client
metadata][client-meta] with values such as "rack-12-1", "rack-12-2", etc. metadata][client-meta] with values such as "rack-12-1", "rack-12-2", etc.
The following constraint would assure that an individual rack is not running The following constraint would assure that an individual rack is not running
more than 2 instances of the task group. more than 2 instances of the task group.
@ -273,7 +273,7 @@ constraint {
This example restricts the task to running on nodes where the binaries for This example restricts the task to running on nodes where the binaries for
redis, cypress, and nginx are all cached locally. This particular example is redis, cypress, and nginx are all cached locally. This particular example is
utilizing node [metadata][meta]. utilizing [custom client metadata][client-meta].
```hcl ```hcl
constraint { constraint {
@ -288,3 +288,4 @@ constraint {
[task]: /docs/job-specification/task.html "Nomad task Job Specification" [task]: /docs/job-specification/task.html "Nomad task Job Specification"
[interpolation]: /docs/runtime/interpolation.html "Nomad interpolation" [interpolation]: /docs/runtime/interpolation.html "Nomad interpolation"
[node-variables]: /docs/runtime/interpolation.html#node-variables- "Nomad interpolation-Node variables" [node-variables]: /docs/runtime/interpolation.html#node-variables- "Nomad interpolation-Node variables"
[client-meta]: /docs/configuration/client.html#custom-metadata-network-speed-and-node-class "Nomad Custom Metadata, Network Speed, and Node Class"