Difference between revisions of "Kubectl label"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 3: Line 3:
 
__NOTOC__
 
__NOTOC__
 
== Commands ==
 
== Commands ==
[[kubectl label --help]]
+
<code>[[kubectl label --help]]</code>
[[kubectl]] label [[pods]] my-pod new-label=awesome_label  
+
 
kubectl label [[nodes]] <node-name> <label-key>=<label-value>
+
<code>[[kubectl]] label [[pods]] my-pod new-label=awesome_label</code>
kubectl label [[Kubernetes namespaces|namespace]] default [[istio]]-injection=enabled
+
 
 +
<code>kubectl label [[nodes]] <node-name> <label-key>=<label-value></code>
 +
 
 +
<code>kubectl label [[Kubernetes namespaces|namespace]] default [[istio]]-injection=enabled</code>
  
 
== Examples ==
 
== Examples ==

Revision as of 07:12, 16 March 2023

kubectl label Update labels on resources (k8.io)

Commands

kubectl label --help

kubectl label pods my-pod new-label=awesome_label

kubectl label nodes <node-name> <label-key>=<label-value>

kubectl label namespace default istio-injection=enabled

Examples

kubectl label namespace default istio-injection=enabled
namespace/default labeled
Related: Install Istio

Errors

kubectl label
error: one or more resources must be specified as <resource> <name> or <resource>/<name>

Related terms

Activities

See also

Advertising: