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

NAME

6       kubectl set serviceaccount - Update ServiceAccount of a resource
7
8
9

SYNOPSIS

11       kubectl set serviceaccount [OPTIONS]
12
13
14

DESCRIPTION

16       Update ServiceAccount of pod template resources.
17
18
19       Possible resources (case insensitive) can be:
20
21
22       replicationcontroller  (rc),  deployment (deploy), daemonset (ds), job,
23       replicaset (rs), statefulset
24
25
26

OPTIONS

28       --all=false
29           Select all resources, including uninitialized ones, in  the  names‐
30       pace of the specified resource types
31
32
33       --allow-missing-template-keys=true
34           If  true, ignore any errors in templates when a field or map key is
35       missing in the template. Only applies to  golang  and  jsonpath  output
36       formats.
37
38
39       --dry-run=false
40           If  true, only print the object that would be sent, without sending
41       it.
42
43
44       -f, --filename=[]
45           Filename, directory, or URL to files identifying  the  resource  to
46       get from a server.
47
48
49       --include-uninitialized=false
50           If  true,  the kubectl command applies to uninitialized objects. If
51       explicitly set to false, this flag overrides other flags that make  the
52       kubectl commands apply to uninitialized objects, e.g., "--all". Objects
53       with empty metadata.initializers are regarded as initialized.
54
55
56       --local=false
57           If true, set serviceaccount will NOT  contact  api-server  but  run
58       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=false
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       --template=""
80           Template  string  or  path  to template file to use when -o=go-tem‐
81       plate, -o=go-template-file. The template format is golang  templates  [
82http://golang.org/pkg/text/template/#pkg-overview⟩].
83
84
85

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

363                # Set Deployment nginx-deployment's ServiceAccount to serviceaccount1
364                kubectl set serviceaccount deployment nginx-deployment serviceaccount1
365
366                # Print the result (in yaml format) of updated nginx deployment with serviceaccount from local file, without hitting apiserver
367                kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run -o yaml
368
369
370
371

SEE ALSO

373       kubectl-set(1),
374
375
376

HISTORY

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