Create filter.md (#3598)

This commit is contained in:
Wang Jie 2017-06-16 05:30:32 +08:00 committed by John Mulhausen
parent bb70a0eb17
commit 5175619a47
1 changed files with 14 additions and 14 deletions

View File

@ -70,9 +70,9 @@ these default tags or custom labels. The Swarm scheduler looks for matching node
on the cluster and starts the container there. This approach has several
practical applications:
* Schedule based on specific host properties, for example,`storage=ssd` schedules
* Schedule based on specific host properties, for example, `storage=ssd` schedules
containers on specific hardware.
* Force containers to run in a given location, for example region=us-east`.
* Force containers to run in a given location, for example `region=us-east`.
* Create logical cluster partitions by splitting a cluster into
sub-clusters with different properties, for example `environment=production`.
@ -194,7 +194,7 @@ Use an `affinity` filter to create "attractions" between containers. For
example, you can run a container and instruct Swarm to schedule it next to
another container based on these affinities:
* container name or id
* container name or ID
* an image on the host
* a custom label applied to the container
@ -505,10 +505,10 @@ The following examples illustrate some possible expressions:
* `constraint:node!=/node-[01]/` matches all nodes, except `node-0` and `node-1`.
* `constraint:node!=/foo\[bar\]/` matches all nodes, except `foo[bar]`. You can see the use of escape characters here.
* `constraint:node==/(?i)node1/` matches node `node1` case-insensitive. So `NoDe1` or `NODE1` also match.
* `affinity:image==~redis` tries to match for nodes running container with a `redis` image
* `constraint:region==~us*` searches for nodes in the cluster belonging to the `us` region
* `affinity:container!=~redis*` schedule a new `redis5` container to a node
without a container that satisfies `redis*`
* `affinity:image==~redis` tries to match for nodes running container with a `redis` image.
* `constraint:region==~us*` searches for nodes in the cluster belonging to the `us` region.
* `affinity:container!=~redis*` schedules a new `redis5` container to a node
without a container that satisfies `redis*`.
## Related information