1KUBERNETES(1)                      Jan 2015                      KUBERNETES(1)
2
3
4

NAME

6       kubectl set selector - Set the selector on a resource
7
8
9

SYNOPSIS

11       kubectl set selector [OPTIONS]
12
13
14

DESCRIPTION

16       Set  the  selector on a resource. Note that the new selector will over‐
17       write the old selector if the resource had one prior to the  invocation
18       of 'set selector'.
19
20
21       A selector must begin with a letter or number, and may contain letters,
22       numbers, hyphens, dots, and  underscores,  up  to   63  characters.  If
23       --resource-version  is  specified,  then updates will use this resource
24       version, otherwise the existing resource-version will  be  used.  Note:
25       currently selectors can only be set on Service objects.
26
27
28

OPTIONS

30       --all=false
31           Select  all  resources  in  the namespace of the specified resource
32       types
33
34
35       --allow-missing-template-keys=true
36           If true, ignore any errors in templates when a field or map key  is
37       missing  in  the  template.  Only applies to golang and jsonpath output
38       formats.
39
40
41       --dry-run=false
42           If true, only print the object that would be sent, without  sending
43       it.
44
45
46       -f, --filename=[]
47           identifying the resource.
48
49
50       --include-uninitialized=false
51           If  true,  the kubectl command applies to uninitialized objects. If
52       explicitly set to false, this flag overrides other flags that make  the
53       kubectl commands apply to uninitialized objects, e.g., "--all". Objects
54       with empty metadata.initializers are regarded as initialized.
55
56
57       --local=false
58           If true, annotation will NOT contact api-server but run locally.
59
60
61       -o, --output=""
62           Output format.  One  of:  json|yaml|name|go-template-file|template‐
63       file|template|go-template|jsonpath|jsonpath-file.
64
65
66       --record=false
67           Record  current  kubectl command in the resource annotation. If set
68       to false, do not record the command. If set to true,  record  the  com‐
69       mand.  If  not  set,  default to updating the existing annotation value
70       only if one already exists.
71
72
73       -R, --recursive=true
74           Process the directory used in -f,  --filename  recursively.  Useful
75       when  you  want  to  manage related manifests organized within the same
76       directory.
77
78
79       --resource-version=""
80           If non-empty, the selectors update will only succeed if this is the
81       current  resource-version  for the object. Only valid when specifying a
82       single resource.
83
84
85       --template=""
86           Template string or path to template file  to  use  when  -o=go-tem‐
87       plate,  -o=go-template-file.  The template format is golang templates [
88http://golang.org/pkg/text/template/#pkg-overview⟩].
89
90
91

OPTIONS INHERITED FROM PARENT COMMANDS

93       --allow-verification-with-non-compliant-keys=false
94           Allow  a  SignatureVerifier  to  use  keys  which  are  technically
95       non-compliant with RFC6962.
96
97
98       --alsologtostderr=false
99           log to standard error as well as files
100
101
102       --application-metrics-count-limit=100
103           Max number of application metrics to store (per container)
104
105
106       --as=""
107           Username to impersonate for the operation
108
109
110       --as-group=[]
111           Group  to  impersonate for the operation, this flag can be repeated
112       to specify multiple groups.
113
114
115       --azure-container-registry-config=""
116           Path to the file containing Azure container registry  configuration
117       information.
118
119
120       --boot-id-file="/proc/sys/kernel/random/boot_id"
121           Comma-separated  list  of files to check for boot-id. Use the first
122       one that exists.
123
124
125       --cache-dir="/builddir/.kube/http-cache"
126           Default HTTP cache directory
127
128
129       --certificate-authority=""
130           Path to a cert file for the certificate authority
131
132
133       --client-certificate=""
134           Path to a client certificate file for TLS
135
136
137       --client-key=""
138           Path to a client key file for TLS
139
140
141       --cloud-provider-gce-lb-src-cidrs=130.211.0.0/22,209.85.152.0/22,209.85.204.0/22,35.191.0.0/16
142           CIDRs opened in GCE firewall for LB traffic proxy  health checks
143
144
145       --cluster=""
146           The name of the kubeconfig cluster to use
147
148
149       --container-hints="/etc/cadvisor/container_hints.json"
150           location of the container hints file
151
152
153       --containerd="unix:///var/run/containerd.sock"
154           containerd endpoint
155
156
157       --context=""
158           The name of the kubeconfig context to use
159
160
161       --default-not-ready-toleration-seconds=300
162           Indicates    the    tolerationSeconds   of   the   toleration   for
163       notReady:NoExecute that is added by default to every pod that does  not
164       already have such a toleration.
165
166
167       --default-unreachable-toleration-seconds=300
168           Indicates  the  tolerationSeconds  of  the  toleration for unreach‐
169       able:NoExecute that is added by default to  every  pod  that  does  not
170       already have such a toleration.
171
172
173       --docker="unix:///var/run/docker.sock"
174           docker endpoint
175
176
177       --docker-env-metadata-whitelist=""
178           a  comma-separated  list of environment variable keys that needs to
179       be collected for docker containers
180
181
182       --docker-only=false
183           Only report docker containers in addition to root stats
184
185
186       --docker-root="/var/lib/docker"
187           DEPRECATED: docker root is read from docker info (this is  a  fall‐
188       back, default: /var/lib/docker)
189
190
191       --docker-tls=false
192           use TLS to connect to docker
193
194
195       --docker-tls-ca="ca.pem"
196           path to trusted CA
197
198
199       --docker-tls-cert="cert.pem"
200           path to client certificate
201
202
203       --docker-tls-key="key.pem"
204           path to private key
205
206
207       --enable-load-reader=false
208           Whether to enable cpu load reader
209
210
211       --event-storage-age-limit="default=0"
212           Max length of time for which to store events (per type). Value is a
213       comma separated list of key values, where  the  keys  are  event  types
214       (e.g.: creation, oom) or "default" and the value is a duration. Default
215       is applied to all non-specified event types
216
217
218       --event-storage-event-limit="default=0"
219           Max number of events to store (per type). Value is  a  comma  sepa‐
220       rated  list  of  key values, where the keys are event types (e.g.: cre‐
221       ation, oom) or "default" and  the  value  is  an  integer.  Default  is
222       applied to all non-specified event types
223
224
225       --global-housekeeping-interval=1m0s
226           Interval between global housekeepings
227
228
229       --google-json-key=""
230           The  Google  Cloud  Platform  Service  Account  JSON Key to use for
231       authentication.
232
233
234       --housekeeping-interval=10s
235           Interval between container housekeepings
236
237
238       --insecure-skip-tls-verify=false
239           If true, the server's certificate will not be checked for validity.
240       This will make your HTTPS connections insecure
241
242
243       --kubeconfig=""
244           Path to the kubeconfig file to use for CLI requests.
245
246
247       --log-backtrace-at=:0
248           when logging hits line file:N, emit a stack trace
249
250
251       --log-cadvisor-usage=false
252           Whether to log the usage of the cAdvisor container
253
254
255       --log-dir=""
256           If non-empty, write log files in this directory
257
258
259       --log-flush-frequency=5s
260           Maximum number of seconds between log flushes
261
262
263       --logtostderr=true
264           log to standard error instead of files
265
266
267       --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
268           Comma-separated  list  of  files  to  check for machine-id. Use the
269       first one that exists.
270
271
272       --match-server-version=false
273           Require server version to match client version
274
275
276       --mesos-agent="127.0.0.1:5051"
277           Mesos agent address
278
279
280       --mesos-agent-timeout=10s
281           Mesos agent timeout
282
283
284       -n, --namespace=""
285           If present, the namespace scope for this CLI request
286
287
288       --request-timeout="0"
289           The length of time to wait before giving  up  on  a  single  server
290       request. Non-zero values should contain a corresponding time unit (e.g.
291       1s, 2m, 3h). A value of zero means don't timeout requests.
292
293
294       -s, --server=""
295           The address and port of the Kubernetes API server
296
297
298       --stderrthreshold=2
299           logs at or above this threshold go to stderr
300
301
302       --storage-driver-buffer-duration=1m0s
303           Writes in the storage driver will be buffered  for  this  duration,
304       and committed to the non memory backends as a single transaction
305
306
307       --storage-driver-db="cadvisor"
308           database name
309
310
311       --storage-driver-host="localhost:8086"
312           database host:port
313
314
315       --storage-driver-password="root"
316           database password
317
318
319       --storage-driver-secure=false
320           use secure connection with database
321
322
323       --storage-driver-table="stats"
324           table name
325
326
327       --storage-driver-user="root"
328           database username
329
330
331       --token=""
332           Bearer token for authentication to the API server
333
334
335       --user=""
336           The name of the kubeconfig user to use
337
338
339       -v, --v=0
340           log level for V logs
341
342
343       --version=false
344           Print version information and quit
345
346
347       --vmodule=
348           comma-separated  list  of pattern=N settings for file-filtered log‐
349       ging
350
351
352

EXAMPLE

354                # set the labels and selector before creating a deployment/service pair.
355                kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f -
356                kubectl create deployment my-dep -o yaml --dry-run | kubectl label --local -f - environment=qa -o yaml | kubectl create -f -
357
358
359
360

SEE ALSO

362       kubectl-set(1),
363
364
365

HISTORY

367       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
368       com)  based  on the kubernetes source material, but hopefully they have
369       been automatically generated since!
370
371
372
373Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum