mirror of https://github.com/docker/docs.git
Add how to use constraints once we created node labels (#2964)
* Add how to use constraints once we created node labels * Fixes as asked by @joaofnfernandes
This commit is contained in:
parent
fd1fd15fa4
commit
3476bae9c5
|
@ -17,9 +17,6 @@ lifecycle, or the hardware resources they have.
|
|||
|
||||

|
||||
|
||||
In this example, when users deploy a service they can add constraints for the
|
||||
service to be scheduled on nodes that have an SSD storage.
|
||||
|
||||
## Apply labels to a node
|
||||
|
||||
Log in with administrator credentials in the **UCP web UI**, navigate to the
|
||||
|
@ -37,6 +34,30 @@ You can also do this from the CLI by running:
|
|||
docker node update --label-add <key>=<value> <node-id>
|
||||
```
|
||||
|
||||
## Add constraint to a service
|
||||
|
||||
When deploying a service, you can specify constraints, so that the service only
|
||||
gets scheduled on a node that has a label that fulfills all the constraints
|
||||
you specify.
|
||||
|
||||
In this example, when users deploy a service they can add constraints for the
|
||||
service to be scheduled on nodes that have an SSD storage.
|
||||
|
||||
You can add deployment constraints to your docker-stack.yml file or when you are creating a stack:
|
||||

|
||||
|
||||
Or you can apply them when you are creating a service.
|
||||
|
||||

|
||||
|
||||
You can check if a service have deployment constraints, navigate to the **Services** page,
|
||||
and choose the service your want to check.
|
||||
Once you're done, click **Scheduling**.
|
||||
|
||||

|
||||
|
||||
From here, you can add or remove deployment constraint too.
|
||||
|
||||
## Where to go next
|
||||
|
||||
* [Store logs in an external system](store-logs-in-an-external-system.md)
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 393 KiB |
Binary file not shown.
After Width: | Height: | Size: 368 KiB |
Binary file not shown.
After Width: | Height: | Size: 472 KiB |
Loading…
Reference in New Issue