1KUBERNETES(1) Jan 2015 KUBERNETES(1)
2
3
4
6 kubectl config set-credentials - Sets a user entry in kubeconfig
7
8
9
11 kubectl config set-credentials [OPTIONS]
12
13
14
16 Sets a user entry in kubeconfig
17
18
19 Specifying a name that already exists will merge new fields on top of
20 existing values.
21
22
23 Client-certificate flags:
24 --client-certificate=certfile --client-key=keyfile
25
26
27 Bearer token flags:
28 --token=bearer_token
29
30
31 Basic auth flags:
32 --username=basic_user --password=basic_password
33
34
35 Bearer token and basic auth are mutually exclusive.
36
37
38
40 --auth-provider=""
41 Auth provider for the user entry in kubeconfig
42
43
44 --auth-provider-arg=[]
45 'key=value' arguments for the auth provider
46
47
48 --embed-certs=false
49 Embed client cert/key for the user entry in kubeconfig
50
51
52 --exec-api-version=""
53 API version of the exec credential plugin for the user entry in
54 kubeconfig
55
56
57 --exec-arg=[]
58 New arguments for the exec credential plugin command for the user
59 entry in kubeconfig
60
61
62 --exec-command=""
63 Command for the exec credential plugin for the user entry in
64 kubeconfig
65
66
67 --exec-env=[]
68 'key=value' environment values for the exec credential plugin
69
70
71
73 --add-dir-header=false
74 If true, adds the file directory to the header
75
76
77 --alsologtostderr=false
78 log to standard error as well as files
79
80
81 --application-metrics-count-limit=100
82 Max number of application metrics to store (per container)
83
84
85 --as=""
86 Username to impersonate for the operation
87
88
89 --as-group=[]
90 Group to impersonate for the operation, this flag can be repeated
91 to specify multiple groups.
92
93
94 --azure-container-registry-config=""
95 Path to the file containing Azure container registry configuration
96 information.
97
98
99 --boot-id-file="/proc/sys/kernel/random/boot_id"
100 Comma-separated list of files to check for boot-id. Use the first
101 one that exists.
102
103
104 --cache-dir="/builddir/.kube/http-cache"
105 Default HTTP cache directory
106
107
108 --certificate-authority=""
109 Path to a cert file for the certificate authority
110
111
112 --client-certificate=""
113 Path to a client certificate file for TLS
114
115
116 --client-key=""
117 Path to a client key file for TLS
118
119
120 --cloud-provider-gce-l7lb-src-cidrs=130.211.0.0/22,35.191.0.0/16
121 CIDRs opened in GCE firewall for L7 LB traffic proxy health checks
122
123
124 --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
125 CIDRs opened in GCE firewall for L4 LB traffic proxy health checks
126
127
128 --cluster=""
129 The name of the kubeconfig cluster to use
130
131
132 --container-hints="/etc/cadvisor/container_hints.json"
133 location of the container hints file
134
135
136 --containerd="/run/containerd/containerd.sock"
137 containerd endpoint
138
139
140 --containerd-namespace="k8s.io"
141 containerd namespace
142
143
144 --context=""
145 The name of the kubeconfig context to use
146
147
148 --default-not-ready-toleration-seconds=300
149 Indicates the tolerationSeconds of the toleration for
150 notReady:NoExecute that is added by default to every pod that does not
151 already have such a toleration.
152
153
154 --default-unreachable-toleration-seconds=300
155 Indicates the tolerationSeconds of the toleration for
156 unreachable:NoExecute that is added by default to every pod that does
157 not already have such a toleration.
158
159
160 --disable-root-cgroup-stats=false
161 Disable collecting root Cgroup stats
162
163
164 --docker="unix:///var/run/docker.sock"
165 docker endpoint
166
167
168 --docker-env-metadata-whitelist=""
169 a comma-separated list of environment variable keys that needs to
170 be collected for docker containers
171
172
173 --docker-only=false
174 Only report docker containers in addition to root stats
175
176
177 --docker-root="/var/lib/docker"
178 DEPRECATED: docker root is read from docker info (this is a
179 fallback, default: /var/lib/docker)
180
181
182 --docker-tls=false
183 use TLS to connect to docker
184
185
186 --docker-tls-ca="ca.pem"
187 path to trusted CA
188
189
190 --docker-tls-cert="cert.pem"
191 path to client certificate
192
193
194 --docker-tls-key="key.pem"
195 path to private key
196
197
198 --enable-load-reader=false
199 Whether to enable cpu load reader
200
201
202 --event-storage-age-limit="default=0"
203 Max length of time for which to store events (per type). Value is a
204 comma separated list of key values, where the keys are event types
205 (e.g.: creation, oom) or "default" and the value is a duration. Default
206 is applied to all non-specified event types
207
208
209 --event-storage-event-limit="default=0"
210 Max number of events to store (per type). Value is a comma
211 separated list of key values, where the keys are event types (e.g.:
212 creation, oom) or "default" and the value is an integer. Default is
213 applied to all non-specified event types
214
215
216 --global-housekeeping-interval=1m0s
217 Interval between global housekeepings
218
219
220 --housekeeping-interval=10s
221 Interval between container housekeepings
222
223
224 --insecure-skip-tls-verify=false
225 If true, the server's certificate will not be checked for validity.
226 This will make your HTTPS connections insecure
227
228
229 --kubeconfig=""
230 use a particular kubeconfig file
231
232
233 --log-backtrace-at=:0
234 when logging hits line file:N, emit a stack trace
235
236
237 --log-cadvisor-usage=false
238 Whether to log the usage of the cAdvisor container
239
240
241 --log-dir=""
242 If non-empty, write log files in this directory
243
244
245 --log-file=""
246 If non-empty, use this log file
247
248
249 --log-file-max-size=1800
250 Defines the maximum size a log file can grow to. Unit is megabytes.
251 If the value is 0, the maximum file size is unlimited.
252
253
254 --log-flush-frequency=5s
255 Maximum number of seconds between log flushes
256
257
258 --logtostderr=true
259 log to standard error instead of files
260
261
262 --machine-id-file="/etc/machine-id,/var/lib/dbus/machine-id"
263 Comma-separated list of files to check for machine-id. Use the
264 first one that exists.
265
266
267 --match-server-version=false
268 Require server version to match client version
269
270
271 -n, --namespace=""
272 If present, the namespace scope for this CLI request
273
274
275 --password=""
276 Password for basic authentication to the API server
277
278
279 --profile="none"
280 Name of profile to capture. One of
281 (none|cpu|heap|goroutine|threadcreate|block|mutex)
282
283
284 --profile-output="profile.pprof"
285 Name of the file to write the profile to
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 --skip-headers=false
299 If true, avoid header prefixes in the log messages
300
301
302 --skip-log-headers=false
303 If true, avoid headers when opening log files
304
305
306 --stderrthreshold=2
307 logs at or above this threshold go to stderr
308
309
310 --storage-driver-buffer-duration=1m0s
311 Writes in the storage driver will be buffered for this duration,
312 and committed to the non memory backends as a single transaction
313
314
315 --storage-driver-db="cadvisor"
316 database name
317
318
319 --storage-driver-host="localhost:8086"
320 database host:port
321
322
323 --storage-driver-password="root"
324 database password
325
326
327 --storage-driver-secure=false
328 use secure connection with database
329
330
331 --storage-driver-table="stats"
332 table name
333
334
335 --storage-driver-user="root"
336 database username
337
338
339 --tls-server-name=""
340 Server name to use for server certificate validation. If it is not
341 provided, the hostname used to contact the server is used
342
343
344 --token=""
345 Bearer token for authentication to the API server
346
347
348 --update-machine-info-interval=5m0s
349 Interval between machine info updates.
350
351
352 --user=""
353 The name of the kubeconfig user to use
354
355
356 --username=""
357 Username for basic authentication to the API server
358
359
360 -v, --v=0
361 number for the log level verbosity
362
363
364 --version=false
365 Print version information and quit
366
367
368 --vmodule=
369 comma-separated list of pattern=N settings for file-filtered
370 logging
371
372
373
375 # Set only the "client-key" field on the "cluster-admin"
376 # entry, without touching other values:
377 kubectl config set-credentials cluster-admin --client-key= /.kube/admin.key
378
379 # Set basic auth for the "cluster-admin" entry
380 kubectl config set-credentials cluster-admin --username=admin --password=uXFGweU9l35qcif
381
382 # Embed client certificate data in the "cluster-admin" entry
383 kubectl config set-credentials cluster-admin --client-certificate= /.kube/admin.crt --embed-certs=true
384
385 # Enable the Google Compute Platform auth provider for the "cluster-admin" entry
386 kubectl config set-credentials cluster-admin --auth-provider=gcp
387
388 # Enable the OpenID Connect auth provider for the "cluster-admin" entry with additional args
389 kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-id=foo --auth-provider-arg=client-secret=bar
390
391 # Remove the "client-secret" config value for the OpenID Connect auth provider for the "cluster-admin" entry
392 kubectl config set-credentials cluster-admin --auth-provider=oidc --auth-provider-arg=client-secret-
393
394 # Enable new exec auth plugin for the "cluster-admin" entry
395 kubectl config set-credentials cluster-admin --exec-command=/path/to/the/executable --exec-api-version=client.authentication.k8s.io/v1beta1
396
397 # Define new exec auth plugin args for the "cluster-admin" entry
398 kubectl config set-credentials cluster-admin --exec-arg=arg1 --exec-arg=arg2
399
400 # Create or update exec auth plugin environment variables for the "cluster-admin" entry
401 kubectl config set-credentials cluster-admin --exec-env=key1=val1 --exec-env=key2=val2
402
403 # Remove exec auth plugin environment variables for the "cluster-admin" entry
404 kubectl config set-credentials cluster-admin --exec-env=var-to-remove-
405
406
407
408
410 kubectl-config(1),
411
412
413
415 January 2015, Originally compiled by Eric Paris (eparis at redhat dot
416 com) based on the kubernetes source material, but hopefully they have
417 been automatically generated since!
418
419
420
421Eric Paris kubernetes User Manuals KUBERNETES(1)