github.com/brahmaroutu/docker@v1.2.1-0.20160809185609-eb28dde01f16/docs/reference/commandline/node_update.md (about) 1 <!--[metadata]> 2 +++ 3 title = "node update" 4 description = "The node update command description and usage" 5 keywords = ["resources, update, dynamically"] 6 [menu.main] 7 parent = "smn_cli" 8 +++ 9 <![end-metadata]--> 10 11 ## update 12 13 ```markdown 14 Usage: docker node update [OPTIONS] NODE 15 16 Update a node 17 18 Options: 19 --availability string Availability of the node (active/pause/drain) 20 --help Print usage 21 --label-add value Add or update a node label (key=value) (default []) 22 --label-rm value Remove a node label if exists (default []) 23 --role string Role of the node (worker/manager) 24 ``` 25 26 ### Add label metadata to a node 27 28 Add metadata to a swarm node using node labels. You can specify a node label as 29 a key with an empty value: 30 31 ``` bash 32 $ docker node update --label-add foo worker1 33 ``` 34 35 To add multiple labels to a node, pass the `--label-add` flag for each label: 36 37 ``` bash 38 $ docker node update --label-add foo --label-add bar worker1 39 ``` 40 41 When you [create a service](service_create.md), 42 you can use node labels as a constraint. A constraint limits the nodes where the 43 scheduler deploys tasks for a service. 44 45 For example, to add a `type` label to identify nodes where the scheduler should 46 deploy message queue service tasks: 47 48 ``` bash 49 $ docker node update --label-add type=queue worker1 50 ``` 51 52 The labels you set for nodes using `docker node update` apply only to the node 53 entity within the swarm. Do not confuse them with the docker daemon labels for 54 [dockerd]( ../../userguide/labels-custom-metadata.md#daemon-labels). 55 56 For more information about labels, refer to [apply custom 57 metadata](../../userguide/labels-custom-metadata.md). 58 59 ## Related information 60 61 * [node inspect](node_inspect.md) 62 * [node ps](node_ps.md) 63 * [node ls](node_ls.md) 64 * [node rm](node_rm.md)