Modifies the log configurations of control plane components. The configurations include the log retention period and components whose logs that you want to collect. Container Service for Kubernetes (ACK) managed clusters can collect the logs of control plane components and deliver the logs to projects in Simple Log Service. These control plane components include Kube-apiserver, kube-scheduler, Kubernetes controller manager, and cloud controller manager (CCM).
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cs:UpdateControlPlaneLog |
update |
*Cluster
|
|
None |
Request syntax
PUT /clusters/{ClusterId}/controlplanelog HTTP/1.1
Path Parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ClusterId |
string |
Yes |
The cluster ID. |
c5b5e80b0b64a4bf6939d2d8fbbc5**** |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request parameters. |
|
| log_project |
string |
No |
The name of the Simple Log Service Project that you want to use to store the logs of control plane components. Default value: k8s-log-$Cluster ID. |
k8s-log-c5b5e80b0b64a4bf6939d2d8fbbc5**** |
| log_ttl |
string |
No |
The retention period of the log data stored in the Logstore. Valid values: 1 to 3000. Unit: days. Default value: 30. |
30 |
| aliuid |
string |
No |
The ID of the Alibaba Cloud account. |
162981***** |
| components |
array |
No |
The control plane components for which you want to enable log collection. |
|
|
string |
No |
The control plane components for which you want to enable log collection. The following control plane components are supported:
|
[ "apiserver", "kcm", "scheduler", "ccm", "alb", "controlplane-events", "ack-goatscaler"] |
UpdateControlPlaneLog 支持仅修改日志存储时间(log_ttl),如果您只在请求体中定义 log_ttl,后台会判定为仅修改存储时间。
UpdateControlPlaneLog 支持通过将 components 字段声明为空列表的方式来关闭所有控制面组件的日志。请在请求体中明确将 components 字段声明为空列表,如果不定义 components,将不会触发关闭控制面组件日志的操作。
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response body. |
||
| cluster_id |
string |
The cluster ID. |
cb95aa626a47740afbf6aa099b650**** |
| request_id |
string |
The request ID. |
687C5BAA-D103-4993-884B-C35E4314**** |
| task_id |
string |
The task ID. |
T-5a54309c80282e39ea00**** |
Examples
Success response
JSON format
{
"cluster_id": "cb95aa626a47740afbf6aa099b650****",
"request_id": "687C5BAA-D103-4993-884B-C35E4314****",
"task_id": "T-5a54309c80282e39ea00****"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.