All Products
Search
Document Center

:Collect monitoring data about Kubernetes resources

Last Updated:Jun 20, 2026

Kubernetes provides multiple metrics. You can collect the metrics from Kubernetes clusters to the Full-stack Observability application for visualization. Simple Log Service and Alibaba Cloud OpenAnolis have jointly developed the non-intrusive monitoring feature. You can use the feature to analyze network traffic flows and identify bottleneck issues for Kubernetes clusters in cloud-native scenarios.

Prerequisites

A Full-stack Observability instance is created. For more information, see Create an instance.

Limits

If you enable data plane monitoring, the host must use an x86_64 Linux kernel version 4.19 or later. For hosts that run CentOS 7.6 to 7.9, kernel version 3.1.0 is also supported. You can run the uname -r command to check the kernel version.

Step 1: Create a Logtail configuration

  1. Log on to the Simple Log Service console.

  2. In the Log Application section, click the Intelligent O&M tab. Then, click Full-stack Observability.

  3. On the Simple Log Service Full-stack Observability page, click the instance you want.

  4. In the left-side navigation pane, click Full-stack Monitoring.

    If this is the first time you use Full-stack Monitoring for this instance, click Enable.

  5. In the left-side navigation pane, click Data Collection. On the Data Import Configurations page, find Resource Monitoring in the Kubernetes Monitoring section.

    If this is the first time you create a data access configuration for the target monitoring item, turn on the switch to open the configuration page. If a configuration already exists, click the 创建 icon to open the configuration page.

  6. Create a machine group.

    If a machine group is created, skip this step.

  7. Download the custom resource definition (CRD) template tool.

    Method

    Description

    Install from outside the cluster

    Requires a ~/.kube/config file on your local machine with permissions to run kubectl commands against the target cluster.

    Install from inside a container

    Uses the permissions of the alibaba-log-controller component to create CRDs. Use this method if you do not have a ~/.kube/config file or if network issues prevent you from connecting to the cluster.

    Install from outside the cluster

    1. Log on to your cluster and download the template tool.

      • China

        curl https://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/kubernetes/crd-tool.tar.gz -o /tmp/crd-tool.tar.gz
      • Regions outside China

        curl https://logtail-release-ap-southeast-1.oss-ap-southeast-1.aliyuncs.com/kubernetes/crd-tool.tar.gz -o /tmp/crd-tool.tar.gz
    2. Install the template tool. A successful installation generates the sls-crd-tool executable in the current directory.

      tar -xvf /tmp/crd-tool.tar.gz -C /tmp &&chmod 755 /tmp/crd-tool/install.sh  && sh -x  /tmp/crd-tool/install.sh
    3. Run ./sls-crd-tool list to verify the installation. The installation is successful if the command returns any output.

    Install from inside a container

    1. Log on to the cluster and access the alibaba-log-controller container.

      kubectl get pods -n kube-system -o wide |grep alibaba-log-controller | awk -F ' ' '{print $1}'
      kubectl exec -it {pod} -n kube-system bash
      cd ~
    2. Download the template tool.

      • If the cluster can access public networks, run one of the following commands:

        • China

          curl https://logtail-release-cn-hangzhou.oss-cn-hangzhou.aliyuncs.com/kubernetes/crd-tool.tar.gz -o /tmp/crd-tool.tar.gz
        • Regions outside China

          curl https://logtail-release-ap-southeast-1.oss-ap-southeast-1.aliyuncs.com/kubernetes/crd-tool.tar.gz -o /tmp/crd-tool.tar.gz
      • If the cluster cannot access public networks, download the tool from outside the cluster and transfer it to the container by using a command such as kubectl cp <source> <destination> or other file transfer methods supported by ACK.

    3. Install the template tool. A successful installation generates the sls-crd-tool executable in the current directory.

      tar -xvf /tmp/crd-tool.tar.gz -C /tmp &&chmod 755 /tmp/crd-tool/install.sh  && sh -x  /tmp/crd-tool/install.sh
    4. Run ./sls-crd-tool list to verify the installation. The installation is successful if the command returns any output.

  8. Use the CRD template tool to generate a Logtail configuration.

    1. Run the following command to view the definition of the template:

      ./sls-crd-tool  get k8sMonitor
    2. Replace the REQUIRED parameter with the current instance ID and run the following command to preview the value of the parameter:

      ./sls-crd-tool  apply -f template-k8sMonitor.yaml --create=false
    3. Check whether the project parameter specifies the project to which the current instance belongs. If yes, run the following command to deploy the template file:

      ./sls-crd-tool  apply -f template-k8sMonitor.yaml
    4. Return to the Data Import Configurations page. If the installation is successful, the Configurations in Resource Monitoring is incremented by one. Otherwise, the count remains unchanged.

Resources for the monitoring component

The Kubernetes resources that are used to collect Kubernetes monitoring data are all created in the sls-monitoring namespace. The resources include one Deployment, one StatefulSet, one DaemonSet, and seven AliyunLogConfig CRDs.

Resource

Resource name

Description

AliyunLogConfig

{instance-id}-k8s-metas

Collects Kubernetes configuration data, such as the name, namespace, label, image, and limit of Deployments, pods, Ingresses, and Services. By default, the collected data is stored in a Logstore named {instance}-metas.

{instance-id}-k8s-metrics

Used to collect the metric data of Kubernetes clusters, including the CPU, memory, and network data of pods and containers. By default, the collected data is stored in a Metricstore named {instance}-k8s-metrics.

{instance-id}-k8s-metrics-kubelet

Used to collect the metric data of Kubernetes kubelet. By default, the collected data is stored in a Metricstore named {instance}-k8s-metrics.

{instance-id}-node-metas

Collects the configuration data of Kubernetes nodes, such as CPU models and memory sizes. By default, the collected data is stored in a Logstore named {instance}-metas.

{instance-id}-node-metrics

Used to collect the metric data of Kubernetes nodes, including CPU utilization and memory usage. By default, the collected data is stored in a Metricstore named {instance}-node-metrics.

What to do next

After you collect Kubernetes monitoring data to Full-stack Observability, Full-stack Observability automatically creates dedicated dashboards for the monitoring data. You can use the dashboards to analyze the monitoring data. For more information, see View dashboards.