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 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 Simple Log Service. The collected logs are sent to the specified Simple Log Service projects of your account in the form of log streams. You are charged for Simple Log Service based on the pay-as-you-go billing method. For more information, see Pay-by-feature.
The default Logstore quota for each Alibaba Cloud account is 50. To increase the quota,
submit a ticket to the Simple Log Service team.
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 Pro clusters. You must manually enable the log collection feature for ACK Basic clusters.
You can select an existing Simple Log Service project in the Log Collection for Control Plane Components section.
Enable the log collection feature for control plane components when you create a cluster
When you create a cluster, select Enable for Log Collection for Control Plane Components on the Component Configurations page. For more information about how to create an ACK cluster, see Create an ACK managed cluster.
You can select an existing Simple Log Service project in the Log Collection for Control Plane Components section.
Enable the log collection feature for control plane components in an existing cluster
Log on to the ACK console. In the left-side navigation pane, click Clusters.
On the Clusters page, click the name of the cluster that you want to manage and choose in the left-side navigation pane.
On the Log Center page, click the Logs of Control Plane Components tab and then 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 Simple Log Service console.
You can query the logs of the kube-apiserver, kube-scheduler, kube-controller-manager, and Cloud Controller Manager control plane components. For more information, see Log search overview.
Query the logs of control plane components 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 Cluster Resources tab and click the URL of Log Service Project for Control Plane Components.
On the page that appears, select the Logstore that stores the logs of control plane components in the left-side Logstores list.
You can also query the logs of the four 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 Logs of Control Plane Components tab. You can select a component and view its logs.
Query the logs of control plane components in the Simple Log Service console
Log on to the Simple Log Service console.
In the Projects section, click the name of the Simple Log Service project that stores the logs of the cluster.
On the page that appears, select the Logstore that stores the logs of control plane components in the left-side
list.
Logstores for control plane components
You can collect logs of four control plane components in ACK clusters. Each Simple Log Service Logstore stores the logs of a control plane component. For more information about the components, see Kubernetes Components. The following table describes the four control plane components.
Component | Logstore | Description |
kube-apiserver | apiserver | kube-apiserver is a component of the Kubernetes control plane that exposes the Kubernetes API. For more information, see kube-apiserver. |
kube-controller-manager | kcm | kube-controller-manager is the internal management and control center of a Kubernetes cluster. The component embeds the core control links shipped with Kubernetes. For more information, see kube-controller-manager. |
kube-scheduler | scheduler | kube-scheduler is the default scheduler of a Kubernetes cluster For more information, see kube-scheduler. |
Cloud Controller Manager | ccm | 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. For more information, see Cloud Controller Manager. |
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, click the name of the cluster that you want to manage and choose in the left-side navigation pane.
On the Log Center page, click the Logs of Control Plane Components tab and then click Close.