.TH "KUBERNETES" "1" " kubernetes User Manuals" "Eric Paris" "Jan 2015" "" .SH NAME .PP kubectl label \- Update the labels on a resource .SH SYNOPSIS .PP \fBkubectl label\fP [OPTIONS] .SH DESCRIPTION .PP Update the labels on a resource. .PP If \-\-overwrite is true, then existing labels can be overwritten, otherwise attempting to overwrite a label will result in an error. If \-\-resource\-version is specified, then updates will use this resource version, otherwise the existing resource\-version will be used. .PP Examples: // Update pod 'foo' with the label 'unhealthy' and the value 'true'. $ kubectl label pods foo unhealthy=true .PP // Update pod 'foo' with the label 'status' and the value 'unhealthy', overwriting any existing value. $ kubectl label \-\-overwrite pods foo status=unhealthy .PP // Update pod 'foo' only if the resource is unchanged from version 1. $ kubectl label pods foo status=unhealthy \-\-resource\-version=1 .PP // Update pod 'foo' by removing a label named 'bar' if it exists. // Does not require the \-\-overwrite flag. $ kubectl label pods foo bar\- .SH OPTIONS .PP \fB\-\-no\-headers\fP=false When using the default output, don't print headers. .PP \fB\-o\fP, \fB\-\-output\fP="" Output format. One of: json|yaml|template|templatefile. .PP \fB\-\-output\-version\fP="" Output the formatted object with the given version (default api\-version). .PP \fB\-\-overwrite\fP=false If true, allow labels to be overwritten, otherwise reject label updates that overwrite existing labels. .PP \fB\-\-resource\-version\fP="" If non\-empty, the labels update will only succeed if this is the current resource\-version for the object. .PP \fB\-t\fP, \fB\-\-template\fP="" Template string or path to template file to use when \-o=template or \-o=templatefile. The template format is golang templates [ \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]] .SH SEE ALSO .PP \fBkubectl(1)\fP, .SH HISTORY .PP January 2015, Originally compiled by Eric Paris (eparis at redhat dot com) based on the kubernetes source material, but hopefully they have been automatically generated since!