Difference between revisions of "Kubectl label"

From wikieduonline
Jump to navigation Jump to search
 
(23 intermediate revisions by 7 users not shown)
Line 1: Line 1:
* https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#label
+
{{lc}}
 +
<code>kubectl label</code> Update labels on resources ([https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#label k8.io])
 +
__NOTOC__
 +
== Commands ==
 +
* <code>[[kubectl label --help]]</code>
 +
* <code>[[kubectl label pods]] my-pod new-label=awesome_label</code>
 +
* <code>[[kubectl label nodes]] <node-name> <label-key>=<label-value></code>
 +
* <code>[[kubectl label namespace]] default [[istio]]-injection=enabled</code>
  
  [[kubectl]] label [[pods]] my-pod new-label=awesome_label
+
== Examples ==
  kubectl label [[nodes]] <node-name> <label-key>=<label-value>
+
  kubectl label [[namespace]] default [[istio]]-injection=enabled
 +
  namespace/default labeled
 +
Related: [[Install Istio]]
  
 +
== Errors ==
 
  kubectl label
 
  kubectl label
 
  error: one or more resources must be specified as <resource> <name> or <resource>/<name>
 
  error: one or more resources must be specified as <resource> <name> or <resource>/<name>
 
kubectl label [[namespace]] default [[istio]]-injection=enabled
 
namespace/default labeled
 
Related: [[Install Istio]]
 
  
 
== Related terms ==
 
== Related terms ==
 
* <code>[[kubectl annotate]]</code>
 
* <code>[[kubectl annotate]]</code>
* <code>[[kubectl get nodes]] --show-labels</code>
+
* <code>[[kubectl get nodes --show-labels]]</code>
* [[Labels (Kubernetes)]]
+
* <code>[[kubectl get pods --show-labels]]</code>
 +
* <code>[[eks.amazonaws.com/compute-type: fargate]]</code>
 +
* <code>[[labels:]]</code>
  
 
== Activities ==
 
== Activities ==
* [[CKA v1.18]]: Use [[label]] selectors to [[schedule Pods]]
+
* [[CKA v1.18: Use label selectors to schedule Pods]]
 
* [[CKA v1.15: Understand how to use Labels, Selector and Annotations]]
 
* [[CKA v1.15: Understand how to use Labels, Selector and Annotations]]
 +
* [[Assign Pods to Nodes using Node Affinity]]
  
 
== See also ==
 
== See also ==
* [[Labels (Kubernetes)]]
+
* {{kubectl label}}
* {{kubectl}}
+
* {{Kubernetes labels}}
  
  
 
[[Category:Kubernetes]]
 
[[Category:Kubernetes]]

Latest revision as of 14:55, 20 November 2023

kubectl label Update labels on resources (k8.io)

Commands[edit]

Examples[edit]

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

Errors[edit]

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

Related terms[edit]

Activities[edit]

See also[edit]

Advertising: