---
title: "calicoctl label"
description: "Reference for the calicoctl label command in Calico Open Source, used to add, change, or remove labels on workload endpoints and nodes."
product: "Calico Open Source"
version: "3.33 (latest)"
section: "Reference"
canonical_url: "https://docs.tigera.io/calico/latest/reference/calicoctl/label"
---

# calicoctl label

This section describes the `calicoctl label` command.

Read the [calicoctl command line interface user reference](https://docs.tigera.io/calico/latest/reference/calicoctl/overview.md) for a full list of calicoctl commands.

> **SECONDARY:** The available actions for a specific resource type may be limited based on the datastore used for Calico (etcdv3 / Kubernetes API). Please refer to the [Resources section](https://docs.tigera.io/calico/latest/reference/resources/overview.md) for details about each resource type.

## Displaying the help text for 'calicoctl label' command

Run `calicoctl label --help` to display the following help menu for the command.

```text
Add, update, or remove labels on an existing Calico resource. Set a label with
key=value (add --overwrite to replace an existing value), or remove one by
passing the key with --remove.

Usage:
  calicoctl label KIND NAME [key=value | key] [flags]

Examples:
  # Add a label to a node.
  calicoctl label nodes node1 cluster=frontend

  # Overwrite an existing label value.
  calicoctl label nodes node1 cluster=backend --overwrite

  # Remove a label.
  calicoctl label nodes node1 cluster --remove

Flags:
  -c, --config string      Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")
  -h, --help               help for label
  -n, --namespace string   Namespace of the resource.
      --overwrite          Overwrite the value when the key is already present in labels.
      --remove             Remove the specified key from labels.

Global Flags:
      --allow-version-mismatch   Allow client and cluster versions mismatch
      --context string           The name of the kubeconfig context to use
  -l, --log-level string         Set the log level (panic, fatal, error, warn, info, debug) (default "panic")
```

### Examples

1. Label a node.

   ```bash
   calicoctl label nodes node1 cluster=backend
   ```

   Results indicate that label was successfully applied.

   ```text
   Successfully set label cluster on nodes node1
   ```

2. Label a node and overwrite the original value of key `cluster`.

   ```bash
   calicoctl label nodes node1 cluster=frontend --overwrite
   ```

   Results indicate that label was successfully overwritten.

   ```text
   Successfully updated label cluster on nodes node1
   ```

3. Remove label with key `cluster` from the node.

   ```bash
   calicoctl label nodes node1 cluster --remove
   ```

   Results indicate that the label was successfully removed.

   ```text
   Successfully removed label cluster from nodes node1.
   ```

### Options

```text
  -n, --namespace string   Namespace of the resource.
      --overwrite          Overwrite the value when the key is already present in labels.
      --remove             Remove the specified key from labels.
```

### General options

```text
  -c, --config string      Path to the file containing connection configuration in YAML or JSON format. (default "/etc/calico/calicoctl.cfg")
```

## See also

- [Installing calicoctl](https://docs.tigera.io/calico/latest/operations/calicoctl/install.md)
- [Resources](https://docs.tigera.io/calico/latest/reference/resources/overview.md) for details on all valid resources, including file format and schema
