Skip to content

Commit c1998ec

Browse files
authored
Merge pull request #52458 from my-git9/npe-17013
[zh-cn]sync kubectl_config_set-cluster.md
2 parents 66fe42c + 4a0e224 commit c1998ec

File tree

1 file changed

+70
-32
lines changed

1 file changed

+70
-32
lines changed

content/zh-cn/docs/reference/kubectl/generated/kubectl_config/kubectl_config_set-cluster.md

Lines changed: 70 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,22 @@ kubectl config set-cluster NAME [--server=server] [--certificate-authority=path/
2828
## {{% heading "examples" %}}
2929

3030
<!--
31+
```
3132
# Set only the server field on the e2e cluster entry without touching other values
33+
kubectl config set-cluster e2e --server=https://1.2.3.4
34+
3235
# Embed certificate authority data for the e2e cluster entry
36+
kubectl config set-cluster e2e --embed-certs --certificate-authority=~/.kube/e2e/kubernetes.ca.crt
37+
3338
# Disable cert checking for the e2e cluster entry
39+
kubectl config set-cluster e2e --insecure-skip-tls-verify=true
40+
3441
# Set the custom TLS server name to use for validation for the e2e cluster entry
42+
kubectl config set-cluster e2e --tls-server-name=my-cluster-name
43+
3544
# Set the proxy URL for the e2e cluster entry
45+
kubectl config set-cluster e2e --proxy-url=https://1.2.3.4
46+
```
3647
-->
3748
```shell
3849
# 仅设置 e2e 集群条目上的 server 字段,不触及其他值
@@ -167,7 +178,8 @@ kubeconfig 中的集群条目的 tls-server-name 字段。
167178
<td colspan="2">--as string</td>
168179
</tr>
169180
<tr>
170-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
181+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
182+
<p>
171183
<!--
172184
Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
173185
-->
@@ -179,7 +191,8 @@ Username to impersonate for the operation. User could be a regular user or a ser
179191
<td colspan="2">--as-group strings</td>
180192
</tr>
181193
<tr>
182-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
194+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
195+
<p>
183196
<!--
184197
Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
185198
-->
@@ -191,7 +204,8 @@ Group to impersonate for the operation, this flag can be repeated to specify mul
191204
<td colspan="2">--as-uid string</td>
192205
</tr>
193206
<tr>
194-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
207+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
208+
<p>
195209
<!--
196210
UID to impersonate for the operation.
197211
-->
@@ -203,7 +217,8 @@ UID to impersonate for the operation.
203217
<td colspan="2">--cache-dir string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: "$HOME/.kube/cache"-->默认值:"$HOME/.kube/cache"</td>
204218
</tr>
205219
<tr>
206-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
220+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
221+
<p>
207222
<!--
208223
Default cache directory
209224
-->
@@ -215,7 +230,8 @@ Default cache directory
215230
<td colspan="2">--certificate-authority string</td>
216231
</tr>
217232
<tr>
218-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
233+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
234+
<p>
219235
<!--
220236
Path to a cert file for the certificate authority
221237
-->
@@ -227,7 +243,8 @@ Path to a cert file for the certificate authority
227243
<td colspan="2">--client-certificate string</td>
228244
</tr>
229245
<tr>
230-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
246+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
247+
<p>
231248
<!--
232249
Path to a client certificate file for TLS
233250
-->
@@ -239,7 +256,8 @@ TLS 客户端证书文件的路径。
239256
<td colspan="2">--client-key string</td>
240257
</tr>
241258
<tr>
242-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
259+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
260+
<p>
243261
<!--
244262
Path to a client key file for TLS
245263
-->
@@ -251,7 +269,8 @@ TLS 客户端密钥文件的路径。
251269
<td colspan="2">--cluster string</td>
252270
</tr>
253271
<tr>
254-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
272+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
273+
<p>
255274
<!--
256275
The name of the kubeconfig cluster to use
257276
-->
@@ -263,7 +282,8 @@ The name of the kubeconfig cluster to use
263282
<td colspan="2">--context string</td>
264283
</tr>
265284
<tr>
266-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
285+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
286+
<p>
267287
<!--
268288
The name of the kubeconfig context to use
269289
-->
@@ -272,34 +292,40 @@ The name of the kubeconfig context to use
272292
</tr>
273293

274294
<tr>
275-
<td colspan="2">--default-not-ready-toleration-seconds int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: 300-->默认值:300</td>
295+
<td colspan="2">--kubeconfig string</td>
276296
</tr>
277297
<tr>
278-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
298+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
299+
<p>
279300
<!--
280-
Indicates the tolerationSeconds of the toleration for notReady:NoExecute that is added by default to every pod that does not already have such a toleration.
301+
use a particular kubeconfig file
281302
-->
282-
设置针对 notReady:NoExecute 的容忍度的 tolerationSeconds,默认添加到所有尚未设置此容忍度的 Pod。
283-
</p></td>
303+
使用特定的 kubeconfig 文件
304+
</p>
305+
</td>
284306
</tr>
285307

286308
<tr>
287-
<td colspan="2">--default-unreachable-toleration-seconds int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: 300-->默认值:300</td>
309+
<td colspan="2">--kuberc string</td>
288310
</tr>
289311
<tr>
290-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
312+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
313+
<p>
291314
<!--
292-
Indicates the tolerationSeconds of the toleration for unreachable:NoExecute that is added by default to every pod that does not already have such a toleration.
315+
Path to the kuberc file to use for preferences. This can be disabled by exporting KUBECTL_KUBERC=false feature gate or turning off the feature KUBERC=off.
293316
-->
294-
设置针对 unreachable:NoExecute 的容忍度的 tolerationSeconds,默认添加到所有尚未设置此容忍度的 Pod。
295-
</p></td>
317+
用于偏好设置的 kuberc 文件的路径。可以通过导出 KUBECTL_KUBERC=false
318+
特性门控或关闭 KUBERC=off 特性门控来禁用此功能。
319+
</p>
320+
</td>
296321
</tr>
297322

298323
<tr>
299324
<td colspan="2">--disable-compression</td>
300325
</tr>
301326
<tr>
302-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
327+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
328+
<p>
303329
<!--
304330
If true, opt-out of response compression for all requests to the server
305331
-->
@@ -311,7 +337,8 @@ If true, opt-out of response compression for all requests to the server
311337
<td colspan="2">--insecure-skip-tls-verify</td>
312338
</tr>
313339
<tr>
314-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
340+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
341+
<p>
315342
<!--
316343
If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
317344
-->
@@ -323,7 +350,8 @@ If true, the server's certificate will not be checked for validity. This will ma
323350
<td colspan="2">--kubeconfig string</td>
324351
</tr>
325352
<tr>
326-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
353+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
354+
<p>
327355
<!--
328356
Path to the kubeconfig file to use for CLI requests.
329357
-->
@@ -335,7 +363,8 @@ CLI 请求要使用的 kubeconfig 文件的路径。
335363
<td colspan="2">--match-server-version</td>
336364
</tr>
337365
<tr>
338-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
366+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
367+
<p>
339368
<!--
340369
Require server version to match client version
341370
-->
@@ -347,7 +376,8 @@ Require server version to match client version
347376
<td colspan="2">-n, --namespace string</td>
348377
</tr>
349378
<tr>
350-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
379+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
380+
<p>
351381
<!--
352382
If present, the namespace scope for this CLI request
353383
-->
@@ -359,7 +389,8 @@ If present, the namespace scope for this CLI request
359389
<td colspan="2">--password string</td>
360390
</tr>
361391
<tr>
362-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
392+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
393+
<p>
363394
<!--
364395
Password for basic authentication to the API server
365396
-->
@@ -371,7 +402,8 @@ Password for basic authentication to the API server
371402
<td colspan="2">--profile string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: "none"-->默认值:"none"</td>
372403
</tr>
373404
<tr>
374-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
405+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
406+
<p>
375407
<!--
376408
Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|mutex)
377409
-->
@@ -383,7 +415,8 @@ Name of profile to capture. One of (none|cpu|heap|goroutine|threadcreate|block|m
383415
<td colspan="2">--profile-output string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: "profile.pprof"-->默认值:"profile.pprof"</td>
384416
</tr>
385417
<tr>
386-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
418+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
419+
<p>
387420
<!--
388421
Name of the file to write the profile to
389422
-->
@@ -395,7 +428,8 @@ Name of the file to write the profile to
395428
<td colspan="2">--request-timeout string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: "0"-->默认值:"0"</td>
396429
</tr>
397430
<tr>
398-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
431+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
432+
<p>
399433
<!--
400434
The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests.
401435
-->
@@ -408,7 +442,8 @@ The length of time to wait before giving up on a single server request. Non-zero
408442
<td colspan="2">-s, --server string</td>
409443
</tr>
410444
<tr>
411-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
445+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
446+
<p>
412447
<!--
413448
The address and port of the Kubernetes API server
414449
-->
@@ -420,7 +455,8 @@ Kubernetes API 服务器的地址和端口。
420455
<td colspan="2">--storage-driver-buffer-duration duration&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: 1m0s-->默认值:1m0s</td>
421456
</tr>
422457
<tr>
423-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
458+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
459+
<p>
424460
<!--
425461
Writes in the storage driver will be buffered for this duration, and committed to the non memory backends as a single transaction
426462
-->
@@ -432,7 +468,8 @@ Writes in the storage driver will be buffered for this duration, and committed t
432468
<td colspan="2">--storage-driver-db string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: "cadvisor"-->默认值:"cadvisor"</td>
433469
</tr>
434470
<tr>
435-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
471+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
472+
<p>
436473
<!--
437474
database name
438475
-->
@@ -444,7 +481,8 @@ database name
444481
<td colspan="2">--storage-driver-host string&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--Default: "localhost:8086"-->默认值:"localhost:8086"</td>
445482
</tr>
446483
<tr>
447-
<td></td><td style="line-height: 130%; word-wrap: break-word;"><p>
484+
<td></td><td style="line-height: 130%; word-wrap: break-word;">
485+
<p>
448486
<!--
449487
database host:port
450488
-->

0 commit comments

Comments
 (0)