All Products
Search
Document Center

How Do I Collect Diagnostics Data from Nodes in an ACK Cluster?

Last Updated: Jun 03, 2021

Overview

When an error occurs in a Container Service for Kubernetes (ACK) cluster or a node in the ACK cluster, you must collect diagnostics data from nodes in the ACK cluster for data analysis. This document describes how to collect diagnostics data from nodes in an ACK cluster.

Details

When an error occurs in an ACK cluster, you must collect diagnostics data from a master node in the ACK cluster. When an error occurs in a worker node, you must collect diagnostics data from a master node and the worker node in the ACK cluster. The following method is applicable to both master and worker nodes. In this example, a master node is used.

Note:

  • Assume that your worker node runs Windows. For more information about how to collect diagnostics data, see the More information section in this document.
  • A node that runs Windows can act only as a worker node.
  1. Log on to a master node in an ACK cluster. For more information, see Use kubectl to connect to an ACK cluster.
  2. Run the following command to download the diagnostics script:
    curl -o /usr/local/bin/diagnose_k8s.sh http://aliacs-k8s-[$Region_ID].oss-cn-[$Region_ID].aliyuncs.com/public/diagnose/diagnose_k8s.sh
    Note: Specify the ID of the region where the cluster resides, such as cn-hangzhou.
  3. Run the following command to grant the execution permissions to the diagnostics script:
    chmod u+x /usr/local/bin/diagnose_k8s.sh
  4. Run the following command to go to the specified directory:
    cd /usr/local/bin
  5. Run the following command to run the diagnostics script:
    diagnose_k8s.sh
    The following output is returned. Each time you run the diagnostics script, a different name is used for the diagnostics report generated. In this example, diagnose_1514939155.tar.gz is used as the diagnostics report name. The name is subject to the actual conditions.
    ......
    + echo 'please get diagnose_1514939155.tar.gz for diagnostics'
    please get diagnose_1514939155.tar.gz for diagnostics
    + echo '请上传 diagnose_1514939155.tar.gz'
    请上传 diagnose_1514939155.tar.gz
  6. Run the following command to view the diagnostics report:
    ls -ltr | grep diagnose_1514939155.tar.gz
    Note : Replace diagnose_1514939155.tar.gz with the name of the diagnostics report generated in actual scenarios.

More information

  1. Log on to the worker node in which an error occurs. For more information, see Use kubectl to connect to an ACK cluster.
  2. Choose Start > Run. In the Run dialog box, enter cmd and click OK to open Command Prompt.
  3. Run the following command to start PowerShell:
    powershell
  1. Run the following command to download and run the diagnostics script:
    Invoke-WebRequest -UseBasicParsing -Uri http://aliacs-k8s-[$Region_ID].oss-cn-[$Region_ID].aliyuncs.com/public/pkg/windows/diagnose/diagnose.ps1 | Invoke-Expression
    The following output is returned, which indicates that the diagnostics data is collected.
    INFO: Compressing diagnosis clues ...
    INFO: ...done
    INFO: Please get diagnoses_1514939155.zip for diagnostics
    Note: Save the diagnoses_1514939155.zip file in the directory where the diagnostics script resides.

Applicable scope

ACK