@@ -27,59 +27,59 @@ kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]
27
27
28
28
<!--
29
29
```
30
- # Return snapshot logs from pod nginx with only one container
31
- kubectl logs nginx
30
+ # Return snapshot logs from pod nginx with only one container
31
+ kubectl logs nginx
32
+
33
+ # Return snapshot logs from pod nginx, prefixing each line with the source pod and container name
34
+ kubectl logs nginx --prefix
32
35
33
- # Return snapshot logs from pod nginx, prefixing each line with the source pod and container name
34
- kubectl logs nginx --prefix
35
-
36
- # Return snapshot logs from pod nginx, limiting output to 500 bytes
37
- kubectl logs nginx --limit-bytes=500
38
-
39
- # Return snapshot logs from pod nginx, waiting up to 20 seconds for it to start running.
40
- kubectl logs nginx --pod-running-timeout=20s
36
+ # Return snapshot logs from pod nginx, limiting output to 500 bytes
37
+ kubectl logs nginx --limit-bytes=500
38
+
39
+ # Return snapshot logs from pod nginx, waiting up to 20 seconds for it to start running.
40
+ kubectl logs nginx --pod-running-timeout=20s
41
41
42
- # Return snapshot logs from pod nginx with multi containers
43
- kubectl logs nginx --all-containers=true
42
+ # Return snapshot logs from pod nginx with multi containers
43
+ kubectl logs nginx --all-containers=true
44
44
45
- # Return snapshot logs from all pods in the deployment nginx
46
- kubectl logs deployment/nginx --all-pods=true
45
+ # Return snapshot logs from all pods in the deployment nginx
46
+ kubectl logs deployment/nginx --all-pods=true
47
47
48
- # Return snapshot logs from all containers in pods defined by label app=nginx
49
- kubectl logs -l app=nginx --all-containers=true
48
+ # Return snapshot logs from all containers in pods defined by label app=nginx
49
+ kubectl logs -l app=nginx --all-containers=true
50
50
51
- # Return snapshot logs from all pods defined by label app=nginx, limiting concurrent log requests to 10 pods
52
- kubectl logs -l app=nginx --max-log-requests=10
51
+ # Return snapshot logs from all pods defined by label app=nginx, limiting concurrent log requests to 10 pods
52
+ kubectl logs -l app=nginx --max-log-requests=10
53
53
54
- # Return snapshot of previous terminated ruby container logs from pod web-1
55
- kubectl logs -p -c ruby web-1
54
+ # Return snapshot of previous terminated ruby container logs from pod web-1
55
+ kubectl logs -p -c ruby web-1
56
56
57
- # Begin streaming the logs from pod nginx, continuing even if errors occur
58
- kubectl logs nginx -f --ignore-errors=true
57
+ # Begin streaming the logs from pod nginx, continuing even if errors occur
58
+ kubectl logs nginx -f --ignore-errors=true
59
59
60
- # Begin streaming the logs of the ruby container in pod web-1
61
- kubectl logs -f -c ruby web-1
60
+ # Begin streaming the logs of the ruby container in pod web-1
61
+ kubectl logs -f -c ruby web-1
62
62
63
- # Begin streaming the logs from all containers in pods defined by label app=nginx
64
- kubectl logs -f -l app=nginx --all-containers=true
63
+ # Begin streaming the logs from all containers in pods defined by label app=nginx
64
+ kubectl logs -f -l app=nginx --all-containers=true
65
65
66
- # Display only the most recent 20 lines of output in pod nginx
67
- kubectl logs --tail=20 nginx
66
+ # Display only the most recent 20 lines of output in pod nginx
67
+ kubectl logs --tail=20 nginx
68
68
69
- # Show all logs from pod nginx written in the last hour
70
- kubectl logs --since=1h nginx
69
+ # Show all logs from pod nginx written in the last hour
70
+ kubectl logs --since=1h nginx
71
71
72
- # Show all logs with timestamps from pod nginx starting from August 30, 2024, at 06:00:00 UTC
73
- kubectl logs nginx --since-time=2024-08-30T06:00:00Z --timestamps=true
72
+ # Show all logs with timestamps from pod nginx starting from August 30, 2024, at 06:00:00 UTC
73
+ kubectl logs nginx --since-time=2024-08-30T06:00:00Z --timestamps=true
74
74
75
- # Show logs from a kubelet with an expired serving certificate
76
- kubectl logs --insecure-skip-tls-verify-backend nginx
75
+ # Show logs from a kubelet with an expired serving certificate
76
+ kubectl logs --insecure-skip-tls-verify-backend nginx
77
77
78
- # Return snapshot logs from first container of a job named hello
79
- kubectl logs job/hello
78
+ # Return snapshot logs from first container of a job named hello
79
+ kubectl logs job/hello
80
80
81
- # Return snapshot logs from container nginx-1 of a deployment named nginx
82
- kubectl logs deployment/nginx -c nginx-1
81
+ # Return snapshot logs from container nginx-1 of a deployment named nginx
82
+ kubectl logs deployment/nginx -c nginx-1
83
83
```
84
84
-->
85
85
``` shell
@@ -479,30 +479,6 @@ The name of the kubeconfig context to use
479
479
</p ></td >
480
480
</tr >
481
481
482
- <tr >
483
- <td colspan =" 2 " >--default-not-ready-toleration-seconds int  ;  ;  ;  ;  ; <!-- Default:--> 默认值:300</td >
484
- </tr >
485
- <tr >
486
- <td ></td ><td style =" line-height : 130% ; word-wrap : break-word ;" ><p >
487
- <!--
488
- 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.
489
- -->
490
- 设置针对 notReady: NoExecute 的容忍度的 tolerationSeconds,默认添加到所有尚未设置此容忍度的 Pod。
491
- </p ></td >
492
- </tr >
493
-
494
- <tr >
495
- <td colspan =" 2 " >--default-unreachable-toleration-seconds int  ;  ;  ;  ;  ; <!-- Default:--> 默认值:300</td >
496
- </tr >
497
- <tr >
498
- <td ></td ><td style =" line-height : 130% ; word-wrap : break-word ;" ><p >
499
- <!--
500
- 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.
501
- -->
502
- 设置针对 unreachable: NoExecute 的容忍度的 tolerationSeconds,默认添加到所有尚未设置此容忍度的 Pod。
503
- </p ></td >
504
- </tr >
505
-
506
482
<tr >
507
483
<td colspan =" 2 " >--disable-compression</td >
508
484
</tr >
@@ -539,6 +515,21 @@ CLI 请求要使用的 kubeconfig 文件的路径。
539
515
</p ></td >
540
516
</tr >
541
517
518
+ <tr >
519
+ <td colspan =" 2 " >--kuberc string</td >
520
+ </tr >
521
+ <tr >
522
+ <td ></td ><td style =" line-height : 130% ; word-wrap : break-word ;" >
523
+ <p >
524
+ <!--
525
+ 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.
526
+ -->
527
+ 用于偏好设置的 kuberc 文件的路径。可以通过导出 KUBECTL_KUBERC=false
528
+ 特性门控或关闭 KUBERC=off 特性门控来禁用此功能。
529
+ </p >
530
+ </td >
531
+ </tr >
532
+
542
533
<tr >
543
534
<td colspan =" 2 " >--match-server-version</td >
544
535
</tr >
0 commit comments