github.com/AliyunContainerService/cli@v0.0.0-20181009023821-814ced4b30d0/docs/reference/commandline/node_update.md (about)

     1  ---
     2  title: "node update"
     3  description: "The node update command description and usage"
     4  keywords: "resources, update, dynamically"
     5  ---
     6  
     7  <!-- This file is maintained within the docker/cli GitHub
     8       repository at https://github.com/docker/cli/. Make all
     9       pull requests against that repo. If you see this file in
    10       another repository, consider it read-only there, as it will
    11       periodically be overwritten by the definitive file. Pull
    12       requests which include edits to this file in other repositories
    13       will be rejected.
    14  -->
    15  
    16  # update
    17  
    18  ```markdown
    19  Usage:  docker node update [OPTIONS] NODE
    20  
    21  Update a node
    22  
    23  Options:
    24        --availability string   Availability of the node ("active"|"pause"|"drain")
    25        --help                  Print usage
    26        --label-add value       Add or update a node label (key=value) (default [])
    27        --label-rm value        Remove a node label if exists (default [])
    28        --role string           Role of the node ("worker"|"manager")
    29  ```
    30  
    31  ## Description
    32  
    33  Update metadata about a node, such as its availability, labels, or roles.
    34  
    35  ## Examples
    36  
    37  ### Add label metadata to a node
    38  
    39  Add metadata to a swarm node using node labels. You can specify a node label as
    40  a key with an empty value:
    41  
    42  ``` bash
    43  $ docker node update --label-add foo worker1
    44  ```
    45  
    46  To add multiple labels to a node, pass the `--label-add` flag for each label:
    47  
    48  ```bash
    49  $ docker node update --label-add foo --label-add bar worker1
    50  ```
    51  
    52  When you [create a service](service_create.md),
    53  you can use node labels as a constraint. A constraint limits the nodes where the
    54  scheduler deploys tasks for a service.
    55  
    56  For example, to add a `type` label to identify nodes where the scheduler should
    57  deploy message queue service tasks:
    58  
    59  ``` bash
    60  $ docker node update --label-add type=queue worker1
    61  ```
    62  
    63  The labels you set for nodes using `docker node update` apply only to the node
    64  entity within the swarm. Do not confuse them with the docker daemon labels for
    65  [dockerd](https://docs.docker.com/engine/userguide/labels-custom-metadata/#daemon-labels).
    66  
    67  For more information about labels, refer to [apply custom
    68  metadata](https://docs.docker.com/engine/userguide/labels-custom-metadata/).
    69  
    70  ## Related commands
    71  
    72  * [node demote](node_demote.md)
    73  * [node inspect](node_inspect.md)
    74  * [node ls](node_ls.md)
    75  * [node promote](node_promote.md)
    76  * [node ps](node_ps.md)
    77  * [node rm](node_rm.md)