tencent cloud

Cloud Log Service

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Features
Available Regions
Limits
Concepts
Service Regions and Service Providers
Purchase Guide
Billing Overview
Product Pricing
Pay-as-You-Go
Billing
Cleaning up CLS resources
Cost Optimization
FAQs
Getting Started
Getting Started in 1 Minute
Getting Started Guide
Quickly Trying out CLS with Demo
Operation Guide
Resource Management
Permission Management
Log Collection
Metric Collection
Log Storage
Metric Storage
Search and Analysis (Log Topic)
Search and Analysis (Metric Topic)
Dashboard
Data Processing documents
Shipping and Consumption
Monitoring Alarm
Cloud Insight
Independent DataSight console
Historical Documentation
Practical Tutorial
Log Collection
Search and Analysis
Dashboard
Monitoring Alarm
Shipping and Consumption
Cost Optimization
Developer Guide
Embedding CLS Console
CLS Connection to Grafana
API Documentation
History
Introduction
API Category
Making API Requests
Topic Management APIs
Log Set Management APIs
Index APIs
Topic Partition APIs
Machine Group APIs
Collection Configuration APIs
Log APIs
Metric APIs
Alarm Policy APIs
Data Processing APIs
Kafka Protocol Consumption APIs
CKafka Shipping Task APIs
Kafka Data Subscription APIs
COS Shipping Task APIs
SCF Delivery Task APIs
Scheduled SQL Analysis APIs
COS Data Import Task APIs
Data Types
Error Codes
FAQs
Health Check
Collection
Log Search
Others
CLS Service Level Agreement
CLS Policy
Privacy Policy
Data Processing And Security Agreement
Contact Us
Glossary

Installing LogListener in Self-built Kubernetes Cluster

PDF
Focus Mode
Font Size
Last updated: 2024-01-20 17:14:28
This document describes how to install LogListener on a self-built Kubernetes cluster to collect logs to CLS.
During the installation process, perform the following operations:
1. Dependencies
Standard Kubernetes cluster. MicroK8s, K3s, or other non-standard Kubernetes clusters are not supported.
Helm 3.1 or later is required.
2. Helm installation For detailed directions, see Installing Helm.
3. LogListener installation
wget https://mirrors.tencent.com/install/cls/k8s/tencentcloud-cls-k8s-install.sh
bash +x tencentcloud-cls-k8s-install.sh
./tencentcloud-cls-k8s-install.sh --region ap-guangzhou --secretid xxx --secretkey xxx
4. Parameter description
Parameter
Description
secretid
Tencent Cloud account access ID
secretkey
Tencent Cloud account access key
region
CLS region
docker_root
The root directory of the cluster Docker. The default value is `/var/lib/docker`. If the actual directory is different from the default one, specify the root directory of Docker.
cluster_id
Cluster ID. If it is not specified, a default ID will be generated during installation (we recommend that you specify a cluster ID, as the generated default ID is less readable).
network
Private network or public network (default).
api_network
Private network or internet (default) for TencentCloud API.
api_region
TencentCloud API region. For more information, see Available Regions.
Sample:
Component deployment in Guangzhou
./tencentcloud-cls-k8s-install.sh --secretid xxx --secretkey xx --region ap-guangzhou --network internet --api_region ap-guangzhou
5. Viewing
5.1 View the installed Helm package. After the successful installation, view the tencent-cloud-cls-log Helm package.
helm list -n kube-system
5.2 View the components.
kubectl get pods -o wide -n kube-system | grep tke-log-agent
kubectl get pods -o wide -n kube-system | grep cls-provisioner
Run the above commands to check whether all components start properly. In normal cases, a tke-log-agent collection Pod and a cls-provisioner Pod will start on each host.
6. LogListener configuration
6.1 Run the following kubectl command to modify the environment variables of tke-log-agent.
kubectl edit ds tke-log-agent -n kube-system
6.2 Edit the environment variables to define LogListener collection configuration.

tapd_20422236_base64_1673580199_31.png


6.3 Parameter description
Variable
Description
MAX_CONNECTION
Maximum number of connections, which is `10` by default.
CHECKPOINT_WINDOW_SIZE
The checkpoint window size of a file, which is `1024` by default.
MAX_FILE_BREAKPOINTS
Breakpoint file size, which is `N*2k`. `N` defaults to `8k`.
MAX_SENDRATE
Maximum sending rate (bytes/s), which is not limited by default.
MAX_FILE
Maximum number of monitored files, which is `15000` by default.
MAX_DIR
Maximum number of monitored directories, which is `5000` by default.
MAX_HTTPS_CONNECTION
Maximum number of HTTPS connections, which is `100` by default.
CONCURRENCY_TASKS
LogListener task pool, which is `256` by default (supported by v3.x or later).
PROCESS_TASKS_EVERY_LOOP
Number of tasks processed every loop, which is `4` by default.
CPU_USAGE_THRES
LogListener memory usage threshold, which is not limited by default.
7. Upgrade
7.1 For Kubernetes 1.13 or later:
wget http://mirrors.tencent.com/install/cls/k8s/upgrade/upgrade.sh
chmod +x upgrade.sh
./upgrade.sh
7.2 For Kubernetes versions earlier than 1.13:
wget http://mirrors.tencent.com/install/cls/k8s/upgrade/upgrade-1.13.sh
chmod +x upgrade-1.13.sh
./upgrade-1.13.sh
8. Uninstallation
Run the following command to uninstall the installed `tencent-cloud-cls-log` Helm package.
helm uninstall tencent-cloud-cls-log -n kube-system
Note:
To completely delete the `tencent-cloud-cls-log` package, regardless of whether you need to redeploy it after specifying the `–cluster_id` parameter incorrectly or you don't need to deploy it any more, you need to run the following command to delete the `secret` of `cls-k8s`, as it saves the `–cluster_id` parameter.
kubectl delete secret -n kube-system cls-k8s


Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback