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       -k, --kustomize=""
57           Process the  kustomization  directory.  This  flag  can't  be  used
58       together with -f or -R.
59
60
61       --local=false
62           If  true,  set  serviceaccount  will NOT contact api-server but run
63       locally.
64
65
66       -o, --output=""
67           Output   format.   One    of:    json|yaml|name|go-template|go-tem‐
68       plate-file|template|templatefile|jsonpath|jsonpath-file.
69
70
71       --record=false
72           Record  current  kubectl command in the resource annotation. If set
73       to false, do not record the command. If set to true,  record  the  com‐
74       mand.  If  not  set,  default to updating the existing annotation value
75       only if one already exists.
76
77
78       -R, --recursive=false
79           Process the directory used in -f,  --filename  recursively.  Useful
80       when  you  want  to  manage related manifests organized within the same
81       directory.
82
83
84       --template=""
85           Template string or path to template file  to  use  when  -o=go-tem‐
86       plate,  -o=go-template-file.  The template format is golang templates [
87http://golang.org/pkg/text/template/#pkg-overview⟩].
88
89
90

OPTIONS INHERITED FROM PARENT COMMANDS

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

EXAMPLE

377                # Set Deployment nginx-deployment's ServiceAccount to serviceaccount1
378                kubectl set serviceaccount deployment nginx-deployment serviceaccount1
379
380                # Print the result (in yaml format) of updated nginx deployment with serviceaccount from local file, without hitting apiserver
381                kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run -o yaml
382
383
384
385

SEE ALSO

387       kubectl-set(1),
388
389
390

HISTORY

392       January 2015, Originally compiled by Eric Paris (eparis at  redhat  dot
393       com)  based  on the kubernetes source material, but hopefully they have
394       been automatically generated since!
395
396
397
398Eric Paris                  kubernetes User Manuals              KUBERNETES(1)
Impressum