wget https://mirrors.tencent.com/install/cls/k8s/addon-charts/tencentcloud-cls-k8s.sh
# Only Linux environments are supported. MacOS is not supported.chmod +x tencentcloud-cls-k8s.sh
./tencentcloud-cls-k8s.sh install --region ap-xxxxxx --secretid xxx --secretkey xxx --network intra
./tencentcloud-cls-k8s.sh install --region ap-xxxxxx --secretid xxx --secretkey xxx --network internet
Parameter | Required | Description |
secretid | Yes | Part of the TencentCloud API Key, SecretId is used to identify the API caller. Ensure that the account associated with the TencentCloud API key has the corresponding self-built K8s log collection and upload permission. |
secretkey | Yes | Part of the TencentCloud API Key, SecretKey is used to encrypt signature strings and is the server-side verification key for signature strings. Ensure the account associated with the TencentCloud API key has the corresponding self-built K8s log collection and upload permission. |
region | Yes | The target region for the CLS service. For region details, see Available Regions, for example: ap-guangzhou. |
network | No | It indicates how LogListener accesses the CLS service. Values: intra for private network access(default) and internet for public network access. Private network access: Applicable when the cluster's server is a Tencent Cloud CVM and the server's region matches the target CLS region. Public network access: Applicable when the cluster's server is not a Tencent Cloud CVM, or when the server's region does not match the target CLS region. |
docker_root | No | The root directory for Docker in the cluster. The default is /var/lib/docker. If the cluster does not use this default directory, you need to specify the specific Docker root directory. |
cluster_id | No | After LogListener is installed on the K8s cluster, a corresponding machine group will be automatically created in CLS. You can specify the name of this machine group by configuring the cluster_id. If not specified, a default ID will be generated during installation (it is recommended to specify a cluster_id, as the default generated ID has poor readability). Note: The specified cluster_id cannot be the same as an existing machine group name. |
local_region | No | The region where the K8s cluster is located. By default, its value is set to be the same as the region parameter. If the K8s cluster region differs from the region parameter, you can customize it. |
api_network | No | Whether the TencentCloud API uses the private network or the public network. Values: intra for private network access and internet for public network access (default). This parameter only needs attention in DC scenarios. |
api_region | No | The region for the TencentCloud API. It only needs attention in DC scenarios. By default, its value is set to be the same as the region parameter. |
namespace | No | Specify the namespace for installing the log collection component. If not specified, it defaults to kube-system (generally, no special specification is required). |
label | No | Supports customizing the Pod Label for the Pod where the log collection component resides. For example: If you want to configure Pod Labels with service=a and app=b for the Pod where the log collection component resides, define the parameter here as --label label.service=a,label.app=b. |
on_master | No | Whether to deploy on the Master node. If not specified, it defaults to false, meaning the collection component is not deployed on the Master node. |
helm list -n kube-system
kubectl get pods -o wide -n kube-system | grep tke-log-agent
kubectl get pods -o wide -n kube-system | grep cls-provisioner
kubectl edit ds tke-log-agent -n kube-system

Variable | Description |
MAX_CONNECTION | Maximum number of connections, default 10. |
CHECKPOINT_WINDOW_SIZE | checkpoint ring length for a single file, default 1,024. |
MAX_FILE_BREAKPOINTS | breakpoint file size, N*2k, N defaults to 8k. |
MAX_SENDRATE | Maximum sending rate, Bytes/s, no limit by default. |
MAX_FILE | Maximum number of monitored files, default 15,000. |
MAX_DIR | Maximum number of monitored directories, default 5,000. |
MAX_HTTPS_CONNECTION | Maximum number of HTTPS connections, default 100. |
CONCURRENCY_TASKS | LogListener task pool, default 256. This configuration is supported only in LogListener v3.0.0 and later versions. Note: LogListener version 3.0.0 and above is provided via an allowlist. If needed, please submit a ticket to apply for access. |
PROCESS_TASKS_EVERY_LOOP | Number of tasks processed per loop, default 4. |
CPU_USAGE_THRES | Maximum CPU utilization for LogListener, consistent with the CPU Limit of the LogListener container by default. |
MAX_MEM | Maximum memory usage limit, consistent with the memory Limit of the LogListener container by default. Unit: Bytes. |
MAX_SEND_RETRY_TIME | Maximum timeout (s) when a log upload request fails and retries, default 10,800. |
./tencentcloud-cls-k8s.sh upgrade --<options>
Parameter | Parameter Description |
upgrade_metrics | Whether to install metric collection components during upgrade. The default value is true, and they are installed during upgrade. |
namespace | The namespace for installing the log collection component. It is installed in kube-system by default and generally does not require special specification. |
kubectl get configmap -n kube-system cls-credential
-n specifies the namespace where LogListener resides, typically kube-system.helm uninstall tencent-cloud-cls-log -n kube-system
-n specifies the namespace where LogListener resides, typically kube-system.kubectl delete secret -n kube-system cls-k8s
kubectl edit ds tke-log-agent -n kube-system


kubectl get nodes -1 node-role.kubernetes.io/control-plane# Or for older cluster versionskubectl get nodes -l node-role.kubernetes.io/master
kubectl describe node ‹node-name>
Taints: node-role.kubernetes.io/control-plane:NoSchedulenode.kubernetes.io/not-ready:NoSchedule
피드백