Log Service allows you to collect Kubernetes container logs in either the DaemonSet or Sidecar mode. This topic describes the procedures and differences of log collection in the two modes.
Log collection in the DaemonSet mode features simple O&M, low resource usage, and flexible collection of container stdout files, stderr files, and text files. However, in the DaemonSet mode, Logtail collects logs from all containers on a node. This mode has performance bottlenecks and causes a loosely isolated environment for business logs. In the Sidecar mode, a Sidecar container is created for each container from which logs are to be collected. This improves multi-tenant isolation and performance.
Log collection configurations
|Feature||Supports all configurations that the console supports and advanced configurations that the console does not support||Moderate|
|Ease of use||Moderate||Low|
|Network connection||Connects to a Kubernetes cluster||Connects to the Internet|
|Integration with container components||Supported||Unsupported|
|Authentication method||Authentication method provided by Kubernetes||Authentication method based on Alibaba Cloud accounts|
The following describes the log collection process in the DaemonSet method.
- Install Logtail.
- Create collection configurations.
Log Service allows you to configure log collection by using CRDs and the console to collect container logs of Kubernetes clusters.
Note If you use CRDs to configure log collection, projects, Logstores, indexes, server groups, Logtail configurations, and other resources are automatically created. In addition, log collection configurations better integrate with Kubernetes clusters. If you are configuring log collection from containers for the first time, you can use the console because the operation is easier.
- Use CRDs to collect Kubernetes container logs in the DaemonSet mode.
- Use the console to collect Kubernetes text logs in the DaemonSet mode.
- Use the console to collect Kubernetes stdout and stderr logs in the DaemonSet mode.
- Install Logtail.
- Install Sidecars and create log collection configurations.
Log service allows you to create collection configurations by using CRDs and the console to collect container logs of Kubernetes clusters.