Command

Kubernetes Add a Label Command

The Kubernetes command to add a label is kubectl label pods my-pod new-label=awesome.

Quick Answer

Command
kubectl label pods my-pod new-label=awesome
KubernetesCommand

Add a Label

Type this command
kubectl label pods my-pod new-label=awesome

Adds a label to a pod.

Learn More

How to add a label in Kubernetes

  1. Open the terminal or command interface for Kubernetes.
  2. Type kubectl label pods my-pod new-label=awesome, replace any placeholders, and run it.

Kubernetes Add a Label Command

Run kubectl label pods my-pod new-label=awesome.

Related Commands

Frequently asked questions

What is the Kubernetes command to add a label?

Run kubectl label pods my-pod new-label=awesome.

Where do I type this Kubernetes command?

Type it in the terminal or command-line interface used by Kubernetes.

Does this Kubernetes command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify