After installing LoongCollector, you can manage its lifecycle. This topic describes how to modify configurations, upgrade the component, and uninstall it.
Core components
Namespace | Name | Type | Function |
kube-system | loongcollector-operator | Deployment | The central controller. It listens for custom resource (CR) events, performs automated management, and creates Simple Log Service (SLS) resources. |
kube-system | loongcollector-ds | DaemonSet | The collection agent that runs on each node. It collects and sends logs. |
loongcollector-operator
Resource type: Deployment. This is a single-instance controller that manages the configuration and coordination of the entire log collection system.
Core responsibilities:
Centralized configuration management: Listens for the creation, update, and deletion of custom resources.
Dynamic configuration delivery: Converts custom resource (CR) rules into specific configurations and sends them to SLS.
loongcollector-ds
Resource type: DaemonSet. A loongcollector-ds pod is automatically deployed and runs on each node in the cluster. When a new node joins the cluster, a pod is deployed on it. When a node leaves the cluster, the pod is removed.
Core responsibilities:
Log collection: Reads container logs and host files on nodes by mounting host directories.
State persistence: Saves collection progress (checkpoints) to a host path on the node. This prevents log loss or duplication that can be caused by pod restarts or migrations.
Configuration hot reloading: Automatically pulls and applies collection configurations from SLS without restarting pods.
ConfigMap configuration
Namespace | Name | Function |
kube-system | alibaba-log-configuration | Stores basic metadata for connecting to SLS. |
kube-system | loongcollector-config | The core connection configuration file for LoongCollector. It defines the endpoints for the configuration service and data uploads. |
Collect ACK cluster logs across accounts or regions
Managing SLS resources using CRs across accounts is not supported.
By default, LoongCollector that is installed from the Container Service for Kubernetes (ACK) console collects container logs from the cluster and sends them to an SLS project in the same account and region. To collect logs across Alibaba Cloud accounts or regions, you must modify the configuration.
Log on to the ACK console. Click the target cluster. In the navigation pane on the left, choose .
On the Helm page, find loongcollector and click Update in the Actions column. On the Update Release page, modify the parameters as described in the following table, leave the other parameters unchanged, and click OK.
Cluster and project
Configuration to modify
Same account, different region
region: The Region ID of the region where the project is located.net: Internet. Service interconnection through the internal network is not available between different regions. Therefore, you must use the Internet to transfer data.Different account, same region
aliUid: The ID of the Alibaba Cloud account that owns SLS. Separate multiple account IDs with commas (,).net: Intranet. We recommend that you use the internal network to transfer data within the same region.Different account, different region
aliUid: The ID of the Alibaba Cloud account that owns SLS. Separate multiple account IDs with commas (,).region: The Region ID of the region where the project is located.net: Internet. Service interconnection through the internal network is not available between different regions. Therefore, you must use the Internet to transfer data.
Modify the network transfer method (Internet/internal network)
ACK cluster
Log on to the ACK console. Click the target cluster. In the navigation pane on the left, choose .
On the Helm page, find loongcollector and click Update in the Actions column. On the Update Release page, modify the
netparameter, leave the other parameters unchanged, and click OK.Internet: The public internet.Intranet: internal network
In the navigation pane on the left, click . In the
kube-systemnamespace, clickalibaba-log-configurationand check whether the value oflog-endpointis updated:If you set the transfer method to
Internet, the value oflog-endpointis${regionId}.log.aliyuncs.com.If you set the transfer method to
Intranet, the value oflog-endpointis${regionId}-intranet.log.aliyuncs.com.
Self-managed cluster
Modify the configuration file: Log on to the server that contains the LoongCollector installation package, go to the
loongcollector-custom-k8s-packageinstallation folder, and modify theneparameter in the./loongcollector/values.yamlconfiguration file as needed:Internet: InternetIntranet: internal network
Apply the update: Save the file and exit. Then, run the following command to update LoongCollector:
bash k8s-custom-install.sh updateVerify the update: Run the following command to verify that the configuration is updated:
kubectl get configmap alibaba-log-configuration -n kube-system -o yamlCheck whether the
log-endpointfield is updated:If you set the transfer method to
Internet, the value oflog-endpointis${regionId}.log.aliyuncs.com.If you set the transfer method to
Intranet, the value oflog-endpointis${regionId}-intranet.log.aliyuncs.com.
Configure LoongCollector collection acceleration
Enable the transfer acceleration endpoint for the project:
Log on to the Simple Log Service console. In the Projects list, click the target project.
Click the
icon next to the project name to open the project overview page. Enable the Acceleration Endpoint.
Verify network connectivity: Log on to a cluster node where the LoongCollector component is installed. Run the following command to verify the network connectivity for transfer acceleration. The transfer acceleration feature is effective only for projects for which it is enabled.
curl ${your-project}.log-global.aliyuncs.comIf the following result is returned, the network connection is normal:
{"Error":{"Code":"OLSInvalidMethod","Message":"The script name is invalid : /","RequestId":"XXXXXXXXXXXXXXXXXXX"}}The error message is returned because the access link is missing required parameters. This test only verifies network connectivity and does not use a complete link. An error message is expected if the network is normal.
Modify the LoongCollector configuration:
ACK cluster
Log on to the ACK console. In the cluster list, click the name of the target cluster.
In the navigation pane on the left, click . In the kube-system namespace, search for
loongcollector-dsand click the name ofloongcollector-dsin the search results.On the
loongcollector-dsbasic information page, click Edit in the upper-right corner. Then, in the Environments section, setALICLOUD_LOG_ENDPOINTtolog-global.aliyuncs.com.After you complete the configuration, click Update.
Self-managed cluster
On a server where kubectl is installed and configured, run the following command to modify
loongcollector-config:kubectl edit configmap loongcollector-config -n kube-systemReplace the
endpoint_listline in the data_servers parameter withlog-global.aliyuncs.com.# $cat /usr/local/ilogtail/ilogtail_config.json { "primary_region" : "cn-beijing", "config_servers" : [ "http://logtail.cn-beijing.log.aliyuncs.com" ], "data_servers" : [ { "region" : "cn-beijing", "endpoint_list": [ "log-global.aliyuncs.com" ] } ] } 1,1 AllPerform a rolling restart of loongcollector-ds to apply the configuration:
kubectl rollout restart daemonset loongcollector-ds -n kube-system
Upgrade LoongCollector
If you installed LoongCollector in ACK, upgrade the component by performing the following steps:
Direct upgrades are not supported for LoongCollector that is installed on self-managed clusters. To upgrade, you must reinstall the LoongCollector component. For more information, see Install LoongCollector.
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, find the one you want to manage and click its name. In the left navigation pane, click Add-ons.
On the Logs and Monitoring tab, find loongcollector and click Upgrade.
In the dialog box that appers, click OK.
Uninstall LoongCollector
ACK cluster
Log on to the ACK console. In the left navigation pane, click Clusters.
On the Clusters page, find the one you want to manage and click its name. In the left navigation pane, click Add-ons.
On the Logs and Monitoring tab, find loongcollector and click Uninstall.
Follow the on-screen instructions and click OK to complete the uninstallation.
Self-managed cluster
Run the following command to uninstall LoongCollector and its related resources:
ImportantBy default, this command does not delete the custom resource definition (CRD) resources that are installed by the chart.
helm uninstall loongcollector -n kube-systemVerify that the dynamic resources related to LoongCollector are cleaned up:
kubectl get pods -A | grep loongcollectorIf no output is returned, the uninstallation is successful.
View the LoongCollector status
Run the following command to view the LoongCollector status.
kubectl get po -n kube-system | grep loongcollector-dsThe following example shows a sample output:
loongcollector-ds-7r8w9 1/1 Running 0 3h13m
loongcollector-ds-gnbwp 1/1 Running 0 3h12m
loongcollector-ds-wmjnt 1/1 Running 0 3h13mView the LoongCollector version
LoongCollector stores its version information in the loongcollector_version field of the /usr/local/ilogtail/app_info.json file. Run the following command to view the LoongCollector version.
In the command, loongcollector-ds-7r8w9 is the pod name. Replace it with the actual pod name.
kubectl exec loongcollector-ds-7r8w9 -n kube-system cat /usr/local/ilogtail/app_info.jsonThe following example shows a sample output:
{
"compiler" : "GCC 9.3.1",
"host_id" : "i-2ze40dgx0trvod9bky2u",
"hostname" : "cn-hangzhou.172.*.*.253",
"instance_id" : "0EBB2B0E-0A3B-11E8-B0CE-0A58AC140402_172.20.4.2_1517810940",
"ip" : "172.23.125.253",
"loongcollector_version" : "3.0.12",
"os" : "Linux; 5.10.134-18.al8.x86_64; #1 SMP Fri Dec 13 16:56:53 CST 2024; x86_64",
"update_time" : "2025-06-20 03:31:54"
}Parameters
loongcollector-ds environment variables
alibaba-log-configuration
loongcollector-config
What to do next
After you install LoongCollector, see Kubernetes cluster container log collection to understand the core principles, key processes, selection suggestions, and best practices for collecting Kubernetes container logs. Then, choose a suitable method to create a collection configuration: