You need to enable JavaScript to run this app.
Torch Log Service

Torch Log Service

Copy page
Download PDF
Collect container logs
LogCollector CRD collection mechanism
Copy page
Download PDF
LogCollector CRD collection mechanism
TLS supports container log collection configuration creation using CRD method. This topic explains how LogCollector CRD works.​
Collection mechanism​
In addition to the console method, TLS provides the LogCollector CRD method for quickly creating LogCollector collection configurations. LogCollector CRD allows you to define and manage TLS resources in a declarative way. It allows you to manage Kubernetes resources using a method similar to CRD. You can define TLS resources in a YAML file and use the kubectl apply command to create or update these resources. TLS automatically creates and updates projects, log topics, host groups, or collection configurations according to your instructions.​
Creating collection configurations using LogCollector CRD is straightforward and efficient. You can quickly batch-create multiple configurations. However, this method requires that you are proficient in Kubernetes and CRD. Therefore, it is suitable for advanced Kubernetes users.​
Basic concepts​
​
Concepts​
Description​
LogCollector CRD​
LogCollector CRD is a Kubernetes resource definition provided by Volcano Engine TLS. Its corresponding custom resource is LogCollector CR. By defining and applying the LogCollector CRD in a Kubernetes cluster, LogCollector CR becomes available in the respective cluster.​
LogCollector CR​
LogCollector CR is a resource instance defined by the LogCollector CRD. You can use the kubectl command line to create, delete, or query LogCollector CRs to manage LogCollector collection configurations. For example, you can create a LogCollector CR to establish a collection configuration.​
LogCollector Controller​
The main function of LogCollector Controller is to monitor the status of LogCollector CRs in the Kubernetes cluster and perform relevant actions. For example, when LogCollector Controller detects a new LogCollector CR, it automatically creates the collection configuration defined in the CR; when LogCollector Controller detects that a LogCollector CR is deleted, it also deletes the relevant collection configuration accordingly.​
​
How LogCollector CRD works​
The internal workflow for collecting container logs by LogCollector CRD is as follows:​
  1. Create LogCollector CRD and LogCollector CR using the kubectl command.​
  1. LogCollector Controller detects updates to the LogCollector CR.​
  1. Based on the LogCollector CR content, LogCollector Controller does the following automatically: sends requests to the TLS server; creates projects, log topics, host groups, and collection configurations; binds collection configurations to host groups.​
  1. LogCollector regularly requests the TLS server for the latest collection configurations and performs hot loading.​
  1. LogCollector collects standard output or text logs from each container based on the collection configuration.​
  1. LogCollector sends the collected logs to the TLS server.​
​
Last updated: 2025.12.05 15:12:18