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
A container runtime handles and redirects any output generated to a containerized application's `stdout` and `stderr` streams.
85
-
Different container runtimes implement this in different ways; however, the integration with the kubelet is standardized
86
-
as the _CRI logging format_.
84
+
A container runtime handles and redirects any output generated to a containerized
85
+
application's `stdout` and `stderr` streams.
86
+
Different container runtimes implement this in different ways; however, the integration
87
+
with the kubelet is standardized as the _CRI logging format_.
87
88
88
-
By default, if a container restarts, the kubelet keeps one terminated container with its logs. If a pod is evicted from the node,
89
-
all corresponding containers are also evicted, along with their logs.
89
+
By default, if a container restarts, the kubelet keeps one terminated container with its logs.
90
+
If a pod is evicted from the node, all corresponding containers are also evicted, along with their logs.
90
91
91
-
The kubelet makes logs available to clients via a special feature of the Kubernetes API. The usual way to access this is
92
-
by running `kubectl logs`.
92
+
The kubelet makes logs available to clients via a special feature of the Kubernetes API.
93
+
The usual way to access this is by running `kubectl logs`.
93
94
94
95
### Log rotation
95
96
@@ -101,7 +102,7 @@ If you configure rotation, the kubelet is responsible for rotating container log
101
102
The kubelet sends this information to the container runtime (using CRI),
102
103
and the runtime writes the container logs to the given location.
103
104
104
-
You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/#kubelet-config-k8s-io-v1beta1-KubeletConfiguration),
105
+
You can configure two kubelet [configuration settings](/docs/reference/config-api/kubelet-config.v1beta1/),
105
106
`containerLogMaxSize` and `containerLogMaxFiles`,
106
107
using the [kubelet configuration file](/docs/tasks/administer-cluster/kubelet-config-file/).
107
108
These settings let you configure the maximum size for each log file and the maximum number of files allowed for each container respectively.
@@ -201,7 +202,8 @@ as your responsibility.
201
202
202
203
## Cluster-level logging architectures
203
204
204
-
While Kubernetes does not provide a native solution for cluster-level logging, there are several common approaches you can consider. Here are some options:
205
+
While Kubernetes does not provide a native solution for cluster-level logging, there are
206
+
several common approaches you can consider. Here are some options:
205
207
206
208
* Use a node-level logging agent that runs on every node.
207
209
* Include a dedicated sidecar container for logging in an application pod.
@@ -211,14 +213,18 @@ While Kubernetes does not provide a native solution for cluster-level logging, t
211
213
212
214

213
215
214
-
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.
216
+
You can implement cluster-level logging by including a _node-level logging agent_ on each node.
217
+
The logging agent is a dedicated tool that exposes logs or pushes logs to a backend.
218
+
Commonly, the logging agent is a container that has access to a directory with log files from all of the
219
+
application containers on that node.
215
220
216
221
Because the logging agent must run on every node, it is recommended to run the agent
217
222
as a `DaemonSet`.
218
223
219
224
Node-level logging creates only one agent per node and doesn't require any changes to the applications running on the node.
220
225
221
-
Containers write to stdout and stderr, but with no agreed format. A node-level agent collects these logs and forwards them for aggregation.
226
+
Containers write to stdout and stderr, but with no agreed format. A node-level agent collects
227
+
these logs and forwards them for aggregation.
222
228
223
229
### Using a sidecar container with the logging agent {#sidecar-container-with-logging-agent}
0 commit comments