You can collect logs of control plane components to manage your clusters in a more secure and efficient manner. Container Service for Kubernetes (ACK) allows you to collect logs of control plane components in ACK managed clusters to Simple Log Service (SLS) projects of your account. This way, you can manage and analyze logs in a centralized manner.
Prerequisites
Your Alibaba Cloud account has a sufficient quota of Logstores in SLS.
The collected logs are sent to the specified SLS projects of your account in the form of log streams. You are charged for SLS based on the pay-as-you-go billing method. For more information, see Pay-by-feature.
Enable the log collection feature for control plane components
You can enable log collection for control plane components by using one of the following methods. For more information about control plane components, see Control Plane Components.
By default, the log collection feature is enabled for control plane components when you create ACK managed Pro cluster. You must manually enable the log collection feature for ACK managed Basic cluster.
You can select an existing Project in the Control Plane Component Logs section.
Enable when you create a cluster
When you create a cluster, select Enable for Control Plane Component Logs in the Component Configurations step. For more information about how to create an ACK cluster, see Create an ACK managed cluster.
Enable in an existing cluster
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side pane, choose .
On the Log Center page, click the Control Plane Component Logs tab, and click Enable Component Log Collection.
Query the logs of control plane components
You can query the logs of control plane components in the ACK console or SLS console. For more information about query syntax, see Create indexes to query and analyze logs.
Query in the ACK console
You can use one of the following methods to query the logs of control plane components in the ACK console:
Query the logs of control plane components in the Cluster Information module.
On the cluster details page, click the Basic Information tab, and click View next to Control Plane Component Logs.
On the Log Center page, select the component to view its logs.
You can also query the logs of control plane components in the Operations module.
In the left-side navigation pane of the cluster details page, choose
.On the Log Center page, click the Control Plane Component Logs tab. You can select a component and view its logs.
Query in the SLS console
Log on to the Simple Log Service console. In the Projects section, click the project that you want to manage.
On the
tab, click the logstore that you want to manage.
Logstores for control plane components
You can collect logs of the following control plane components in ACK clusters. Each SLS Logstore stores the logs of a control plane component. For more information about the components, see Kubernetes Components.
Component | Logstore | Whether to collect logs by default | Description |
apiserver | Yes | kube-apiserver is a component of the Kubernetes control plane that exposes the Kubernetes API. | |
kcm | Yes | kube-controller-manager is the internal management and control center of a Kubernetes cluster. The component embeds the core control links shipped with Kubernetes. | |
scheduler | Yes | kube-scheduler is the default scheduler of a Kubernetes cluster. | |
ccm | Yes | Cloud Controller Manager allows you to integrate Kubernetes with Alibaba Cloud services, such as Classic Load Balancer (CLB) and Virtual Private Cloud (VPC). CLB is formerly known as Server Load Balancer (SLB). Cloud Controller Manager manages the features, such as load balancing and cross-node communication, that are provided by these services. | |
controlplane-events | controlplane-events | Yes | controlplane-events delivers operational events of cluster control plane components, such as out of memory (OOM) killed events. |
alb | Yes | ALB Ingress provides a unified entry for Services in a cluster based on Application Load Balancer (ALB) of Alibaba Cloud. | |
cluster-autoscaler | No | cluster-autoscaler is the node autoscaling component for ACK. | |
ack-goatscaler | No | ack-goatscaler is the instant elasticity component for ACK nodes. | |
kuberay-operator | No | kuberay-operator is based on the community KubeRay component and combines the scheduling, elastic quota, resource priority scheduling, and other capabilities of ACK to help you manage and use Ray cluster services more conveniently. |
If the Whether to collect logs by default column of the component is No and you want to collect logs from the component, you must enable log collection for the component by updating the list of components for log collection.
Update the list of components for log collection
You can modify whether to enable log collection for specified control plane components.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side pane, choose .
On the Log Center page, click the Control Plane Component Logs tab, and then click Update Component.
In the dialog box that appears, modify the selection status of the specified components, and then click OK.
NoteIf all components are deselected, the control plane component log feature will be disabled.
Disable the log collection feature for control plane components
You can disable the log collection feature for control plane components in the Operations module in the ACK console.
On the Clusters page, find the cluster that you want to manage and click its name. In the left-side pane, choose .
On the Log Center page, click the Logs of Control Plane Components tab, then click Close.