tencent cloud

Tencent Kubernetes Engine

소식 및 공지 사항
릴리스 노트
제품 릴리스 기록
제품 소개
제품 장점
제품 아키텍처
시나리오
제품 기능
리전 및 가용존
빠른 시작
신규 사용자 가이드
표준 클러스터를 빠르게 생성
Demo
클라우드에서 컨테이너화된 애플리케이션 배포 Check List
TKE 표준 클러스터 가이드
Tencent Kubernetes Engine(TKE)
클러스터 관리
네트워크 관리
스토리지 관리
Worker 노드 소개
Kubernetes Object Management
워크로드
클라우드 네이티브 서비스 가이드
Tencent Managed Service for Prometheus
TKE Serverless 클러스터 가이드
TKE 클러스터 등록 가이드
실습 튜토리얼
Serverless 클러스터
네트워크
로그
모니터링
유지보수
DevOps
탄력적 스케일링
자주 묻는 질문
클러스터
TKE Serverless 클러스터
유지보수
서비스
이미지 레지스트리
원격 터미널
문서Tencent Kubernetes Engine

Log Collection Overview

포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-12-25 14:58:52

Applicable Scenarios

The log collection feature is a cluster log collection tool provided by Tencent Kubernetes Engine (TKE), which allows you to send logs in specific paths of cluster services or nodes to Tencent Cloud Log Service (CLS) and TDMQ for CKafka (CKafka). This feature applies to users who need to store and analyze service logs within Kubernetes clusters.
You need to manually enable log collection for each cluster, and configure the collection rules. After log collection is enabled for a cluster, the log collection agent runs as a DaemonSet in the cluster, collects logs from the collection source based on the collection source, CLS log topic, and log parsing method configured by users in the log collection rules, and sends the collected log to the consumer. You can enable log collection for a cluster according to the section Operation Steps.

Prerequisites

Before enabling log collection, ensure that there are sufficient resources on the cluster nodes.
0.11 to 1.1 CPU cores are required. You can increase the CPU resources on your own as needed.
24 to 560 MB memory is required. You can increase the memory resources on your own as needed.
The maximum size of a log is 512 KB. A log greater than 512 KB will be truncated.
To use the log collection feature, ensure that nodes in the Kubernetes cluster can access the log consumer. Additionally, the log collection feature is available only for clusters of Kubernetes 1.10 and later.

Basic Concepts

Log Collection Agent

The agent that TKE uses to collect logs is Loglistener, which runs within the cluster as a DaemonSet.

Log Rules

Users can use log rules to specify the log collection source, log topic, and log parsing method, and configure the filter.
The log collection agent monitors changes in log collection rules. Such changes take effect within 10 seconds.
Multiple log collection rules do not lead to creation of multiple DaemonSets, but too many log collection rules will increase the resources occupied by the log collection agent.

Log Source

It includes the specified container standard output, files in containers, and node files.
When collecting container standard output logs, users can select TKE logs in all containers or specified workloads and specified Pod labels as the log collection source.
When collecting container file path logs, users can specify container file path logs in workloads or Pod labels as the log collection source.
When collecting node file path logs, users can set node file path logs as the log collection source.

Consumer

Users can select a CLS log set or log topic as the consumer.

Extraction Mode

The log collection agent allows you to send the collected logs to the specified log topic in the format of single-line text, multi-line text, single-line full regex, multi-line full regex, JSON, separator-based text, or combined parsing.

Filter

After enabling the filter, you can collect logs based on user-specified collection rules. "key" supports exact matching, and filtering rules support regex matching. For example, only collect logs containing ErrorCode = 404.

Operation Steps

Enabling Log Collection

1. Log in to the TKE console, and select Feature Management in the left sidebar.
2. At the top of the Ops Management page, select a region, and click Set on the right side of the target cluster, as shown in the figure below.



3. On the Configure features page, click Edit on the right side of Log collection.
4. Select Enable log collection, and click Confirm, as shown in the figure below.

5. After enabling, you can view the log collection status on the Ops Management page, as shown in the figure below.


Disabling Log Collection

1. Log in to the TKE console, and select Feature Management in the left sidebar.
2. At the top of the Ops Management page, select a region, and click Set on the right side of the cluster for which log collection needs to be disabled, as shown in the figure below.

3. On the Configure features page, click Edit on the right side of Log collection.
4. Unselect Enable log collection, and click Confirm, as shown in the figure below.



도움말 및 지원

문제 해결에 도움이 되었나요?

피드백