Skip to content

Commit

Permalink
fix constraints/preferences documentation
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
  • Loading branch information
ndeloof committed May 27, 2024
1 parent a8751e8 commit 20ebf93
Showing 1 changed file with 5 additions and 19 deletions.
24 changes: 5 additions & 19 deletions deploy.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ services:

#### constraints

`constraints` defines a required property the platform's node must fulfill to run the service container. It can be set either
by a list or a map with string values.
`constraints` defines a required property the platform's node must fulfill to run the service container.
See example usage [here](https://docs.docker.com/reference/cli/docker/service/create/#constraint)

```yml
deploy:
Expand All @@ -75,30 +75,16 @@ deploy:
- disktype=ssd
```

```yml
deploy:
placement:
constraints:
disktype: ssd
```

#### preferences

`preferences` defines a property the platform's node should fulfill to run service container. It can be set either
by a list or a map with string values.

```yml
deploy:
placement:
preferences:
- datacenter=us-east
```
`preferences` defines a strategy (currently `spread` is the only supported strategy) to spread tasks evenly
over the values of the datacenter node label. See example usage [here]https://docs.docker.com/reference/cli/docker/service/create/#placement-pref)

```yml
deploy:
placement:
preferences:
datacenter: us-east
- spread: node.labels.zone
```

### replicas
Expand Down

0 comments on commit 20ebf93

Please sign in to comment.