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

EXAMPLE

369                # set the labels and selector before creating a deployment/service pair.
370                kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f -
371                kubectl create deployment my-dep -o yaml --dry-run | kubectl label --local -f - environment=qa -o yaml | kubectl create -f -
372
373
374
375

SEE ALSO

377       kubectl-set(1),
378
379
380

HISTORY

382       January  2015,  Originally compiled by Eric Paris (eparis at redhat dot
383       com) based on the kubernetes source material, but hopefully  they  have
384       been automatically generated since!
385
386
387
388Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum