You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
By default, if a container restarts, the kubelet keeps one terminated container with its logs. If a pod is evicted from the node,
148
-
all corresponding containers are also evicted, along with their logs.
148
+
By default, if a container restarts, the kubelet keeps one terminated container with its logs.
149
+
If a pod is evicted from the node, all corresponding containers are also evicted, along with their logs.
149
150
150
-
The kubelet makes logs available to clients via a special feature of the Kubernetes API. The usual way to access this is
151
-
by running `kubectl logs`.
151
+
The kubelet makes logs available to clients via a special feature of the Kubernetes API.
152
+
The usual way to access this is by running `kubectl logs`.
152
153
-->
153
154
默认情况下,如果容器重新启动,kubelet 会保留一个终止的容器及其日志。
154
155
如果一个 Pod 被逐出节点,所对应的所有容器及其日志也会被逐出。
@@ -176,7 +177,7 @@ and the runtime writes the container logs to the given location.
176
177
kubelet(使用 CRI)将此信息发送到容器运行时,而运行时则将容器日志写到给定位置。
177
178
178
179
<!--
179
-
You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration),
180
+
You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/),
180
181
`containerLogMaxSize` and `containerLogMaxFiles`,
181
182
using the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file/).
182
183
These settings let you configure the maximum size for each log file and the maximum number of files allowed for each container respectively.
@@ -185,7 +186,7 @@ When you run [`kubectl logs`](/docs/reference/generated/kubectl/kubectl-commands
185
186
the basic logging example, the kubelet on the node handles the request and
186
187
reads directly from the log file. The kubelet returns the content of the log file.
While Kubernetes does not provide a native solution for cluster-level logging, there are several common approaches you can consider. Here are some options:
357
+
While Kubernetes does not provide a native solution for cluster-level logging, there are
358
+
several common approaches you can consider. Here are some options:
357
359
358
360
* Use a node-level logging agent that runs on every node.
359
361
* Include a dedicated sidecar container for logging in an application pod.
@@ -378,9 +380,12 @@ While Kubernetes does not provide a native solution for cluster-level logging, t
You can implement cluster-level logging by including a _node-level logging agent_ on each node. The logging agent is a dedicated tool that exposes logs or pushes logs to a backend. Commonly, the logging agent is a container that has access to a directory with log files from all of the application containers on that node.
383
+
You can implement cluster-level logging by including a _node-level logging agent_ on each node.
384
+
The logging agent is a dedicated tool that exposes logs or pushes logs to a backend.
385
+
Commonly, the logging agent is a container that has access to a directory with log files from all of the
386
+
application containers on that node.
382
387
-->
383
-
你可以通过在每个节点上使用**节点级的日志记录代理**来实现集群级日志记录。
388
+
你可以通过在每个节点上使用**节点级的日志记录代理**来实现集群级日志记录。
384
389
日志记录代理是一种用于暴露日志或将日志推送到后端的专用工具。
385
390
通常,日志记录代理程序是一个容器,它可以访问包含该节点上所有应用程序容器的日志文件的目录。
386
391
@@ -395,7 +400,8 @@ Node-level logging creates only one agent per node and doesn't require any chang
395
400
节点级日志在每个节点上仅创建一个代理,不需要对节点上的应用做修改。
396
401
397
402
<!--
398
-
Containers write to stdout and stderr, but with no agreed format. A node-level agent collects these logs and forwards them for aggregation.
403
+
Containers write to stdout and stderr, but with no agreed format. A node-level agent collects
404
+
these logs and forwards them for aggregation.
399
405
-->
400
406
容器向标准输出和标准错误输出写出数据,但在格式上并不统一。
401
407
节点级代理收集这些日志并将其进行转发以完成汇总。
@@ -654,4 +660,3 @@ Cluster-logging that exposes or pushes logs directly from every application is o
0 commit comments