Help Center/ Cloud Container Engine/ User Guide/ Observability/ Logging/ Collecting Control Plane Component Logs
Updated on 2024-09-30 GMT+08:00

Collecting Control Plane Component Logs

CCE supports logging for master nodes. On the Logging page, you can select one or more control plane components (kube-controller-manager, kube-apiserver, and kube-scheduler) whose logs need to be reported.

Constraints

  • The cluster version must be v1.21.7-r0 or later, v1.23.5-r0 or later, or 1.25.
  • There is required LTS resource quota. For details about the default LTS quota, see Basic Resources.

Control Plane Components

There are three control plane log types. Each log stream corresponds to a component of the Kubernetes control plane. To learn more about these components, see Kubernetes Components.

Table 1 Control plane components

Log Type

Component

Log Stream

Description

Control plane component logs

kube-apiserver

kube-apiserver-{{clusterID}}

It exposes Kubernetes APIs. For more information, see kube-apiserver.

kube-controller-manager

kube-controller-manager-{{clusterID}}

It manages controllers and embeds the core control loops shipped with Kubernetes. For more information, see kube-controller-manager.

kube-scheduler

kube-scheduler-{{clusterID}}

It manages when and where to run Pods in your cluster. For more information, see kube-scheduler.

Enabling Control Plane Logging

Enabling control plane logging during cluster creation

  1. Log in to the CCE console.
  2. In the upper right corner, click Buy Cluster. Then, configure the parameters and click Next: Select Add-on.
  3. On the displayed page, select Cloud Native Logging and click Next: Add-on Configuration.
  4. On the displayed page, select Control Plane Logs for Cloud Native Logging.
    Figure 1 Enabling control plane logging during cluster creation
  5. Click Next: Confirm Configuration.
Enabling control plane logging for an existing cluster
  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. Click the Control Plane Logs tab, select one or more control plane components whose logs need to be collected, and click Enable.
    Figure 2 Selecting control plane components

Viewing Control Plane Component Logs of the Target Cluster

Viewing control plane component logs of the target cluster on the CCE console

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. Click the Control Plane Logs tab and select the topic of logs to be viewed. For details about available control plane log types, see Control Plane Components. For details about related operations, see LTS User Guide.
    Figure 3 Viewing control plane component logs

Viewing control plane component logs of the target cluster on the LTS console

  1. Log in to the LTS console and choose Log Management.
  2. Search for the log group by cluster ID and click the log group name to view the log streams. For details, see LTS User Guide.
    Figure 4 Viewing control plane component logs on the LTS console

Disabling Control Plane Logging

  1. Log in to the CCE console and click the cluster name to access the cluster console. In the navigation pane, choose Logging.
  2. Click the Control Plane Logs tab. In the upper right corner, click Configure Control Plane Component Logs. Then, modify the log setting.
    Figure 5 Disabling control plane logging
  3. Determine whether to enable logging for each component. If yes, click OK.

    After you disable control plane logging, logs are no longer written to the original log stream, but the existing logs will not be deleted and expenses may be incurred for this.