tencent cloud

Tencent Kubernetes Engine

Release Notes and Announcements
Release Notes
Announcements
Release Notes
Product Introduction
Overview
Strengths
Architecture
Scenarios
Features
Concepts
Native Kubernetes Terms
Common High-Risk Operations
Regions and Availability Zones
Service Regions and Service Providers
Open Source Components
Purchase Guide
Purchase Instructions
Purchase a TKE General Cluster
Purchasing Native Nodes
Purchasing a Super Node
Getting Started
Beginner’s Guide
Quickly Creating a Standard Cluster
Examples
Container Application Deployment Check List
Cluster Configuration
General Cluster Overview
Cluster Management
Network Management
Storage Management
Node Management
GPU Resource Management
Remote Terminals
Application Configuration
Workload Management
Service and Configuration Management
Component and Application Management
Auto Scaling
Container Login Methods
Observability Configuration
Ops Observability
Cost Insights and Optimization
Scheduler Configuration
Scheduling Component Overview
Resource Utilization Optimization Scheduling
Business Priority Assurance Scheduling
QoS Awareness Scheduling
Security and Stability
TKE Security Group Settings
Identity Authentication and Authorization
Application Security
Multi-cluster Management
Planned Upgrade
Backup Center
Cloud Native Service Guide
Cloud Service for etcd
TMP
TKE Serverless Cluster Guide
TKE Registered Cluster Guide
Use Cases
Cluster
Serverless Cluster
Scheduling
Security
Service Deployment
Network
Release
Logs
Monitoring
OPS
Terraform
DevOps
Auto Scaling
Containerization
Microservice
Cost Management
Hybrid Cloud
AI
Troubleshooting
Disk Full
High Workload
Memory Fragmentation
Cluster DNS Troubleshooting
Cluster kube-proxy Troubleshooting
Cluster API Server Inaccessibility Troubleshooting
Service and Ingress Inaccessibility Troubleshooting
Common Service & Ingress Errors and Solutions
Engel Ingres appears in Connechtin Reverside
CLB Ingress Creation Error
Troubleshooting for Pod Network Inaccessibility
Pod Status Exception and Handling
Authorizing Tencent Cloud OPS Team for Troubleshooting
CLB Loopback
API Documentation
History
Introduction
API Category
Making API Requests
Elastic Cluster APIs
Resource Reserved Coupon APIs
Cluster APIs
Third-party Node APIs
Relevant APIs for Addon
Network APIs
Node APIs
Node Pool APIs
TKE Edge Cluster APIs
Cloud Native Monitoring APIs
Scaling group APIs
Super Node APIs
Other APIs
Data Types
Error Codes
TKE API 2022-05-01
FAQs
TKE General Cluster
TKE Serverless Cluster
About OPS
Hidden Danger Handling
About Services
Image Repositories
About Remote Terminals
Event FAQs
Resource Management
Service Agreement
TKE Service Level Agreement
TKE Serverless Service Level Agreement
Contact Us
Glossary

Log Collection Overview

PDF
Mode fokus
Ukuran font
Terakhir diperbarui: 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.



Bantuan dan Dukungan

Apakah halaman ini membantu?

masukan