github.com/pwn-term/docker@v0.0.0-20210616085119-6e977cce2565/cli/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  # update
     8  
     9  ```markdown
    10  Usage:  docker node update [OPTIONS] NODE
    11  
    12  Update a node
    13  
    14  Options:
    15        --availability string   Availability of the node ("active"|"pause"|"drain")
    16        --help                  Print usage
    17        --label-add value       Add or update a node label (key=value) (default [])
    18        --label-rm value        Remove a node label if exists (default [])
    19        --role string           Role of the node ("worker"|"manager")
    20  ```
    21  
    22  ## Description
    23  
    24  Update metadata about a node, such as its availability, labels, or roles.
    25  
    26  > **Note**
    27  >
    28  > This is a cluster management command, and must be executed on a swarm
    29  > manager node. To learn about managers and workers, refer to the
    30  > [Swarm mode section](https://docs.docker.com/engine/swarm/) in the
    31  > documentation.
    32  
    33  ## Examples
    34  
    35  ### Add label metadata to a node
    36  
    37  Add metadata to a swarm node using node labels. You can specify a node label as
    38  a key with an empty value:
    39  
    40  ``` bash
    41  $ docker node update --label-add foo worker1
    42  ```
    43  
    44  To add multiple labels to a node, pass the `--label-add` flag for each label:
    45  
    46  ```bash
    47  $ docker node update --label-add foo --label-add bar worker1
    48  ```
    49  
    50  When you [create a service](service_create.md),
    51  you can use node labels as a constraint. A constraint limits the nodes where the
    52  scheduler deploys tasks for a service.
    53  
    54  For example, to add a `type` label to identify nodes where the scheduler should
    55  deploy message queue service tasks:
    56  
    57  ``` bash
    58  $ docker node update --label-add type=queue worker1
    59  ```
    60  
    61  The labels you set for nodes using `docker node update` apply only to the node
    62  entity within the swarm. Do not confuse them with the docker daemon labels for
    63  [dockerd](dockerd.md).
    64  
    65  For more information about labels, refer to [apply custom
    66  metadata](https://docs.docker.com/engine/userguide/labels-custom-metadata/).
    67  
    68  ## Related commands
    69  
    70  * [node demote](node_demote.md)
    71  * [node inspect](node_inspect.md)
    72  * [node ls](node_ls.md)
    73  * [node promote](node_promote.md)
    74  * [node ps](node_ps.md)
    75  * [node rm](node_rm.md)