Skip to content

Commit 5a6905f

Browse files
authored
Merge pull request #52299 from my-git9/npa-1015
[zh-cn]sync kubectl_logs/_index.md
2 parents 1c3bc00 + 27619aa commit 5a6905f

File tree

1 file changed

+53
-62
lines changed
  • content/zh-cn/docs/reference/kubectl/generated/kubectl_logs

1 file changed

+53
-62
lines changed

content/zh-cn/docs/reference/kubectl/generated/kubectl_logs/_index.md

Lines changed: 53 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -27,59 +27,59 @@ kubectl logs [-f] [-p] (POD | TYPE/NAME) [-c CONTAINER]
2727

2828
<!--
2929
```
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
3235
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
4141
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
4444
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
4747
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
5050
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
5353
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
5656
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
5959
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
6262
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
6565
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
6868
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
7171
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
7474
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
7777
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
8080
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
8383
```
8484
-->
8585
```shell
@@ -479,30 +479,6 @@ The name of the kubeconfig context to use
479479
</p></td>
480480
</tr>
481481

482-
<tr>
483-
<td colspan="2">--default-not-ready-toleration-seconds int&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<!--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-
506482
<tr>
507483
<td colspan="2">--disable-compression</td>
508484
</tr>
@@ -539,6 +515,21 @@ CLI 请求要使用的 kubeconfig 文件的路径。
539515
</p></td>
540516
</tr>
541517

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+
542533
<tr>
543534
<td colspan="2">--match-server-version</td>
544535
</tr>

0 commit comments

Comments
 (0)