You can call the ModifyClusterAddon operation to modify the configurations of a component that is installed in a cluster.
You can use this API operation to modify the components in a Container Service for Kubernetes (ACK) cluster or the control plane components in an ACK Pro cluster.
-
To query the customizable parameters of a component, call the
DescribeClusterAddonMetadataAPI operation. For more information, see Query the metadata of a specified component version. - For more information about the customizable parameters of control plane components in ACK Pro clusters, see Customize the parameters of control plane components in ACK Pro clusters.
After you call this operation, the component may be redeployed and restarted. We recommend that you evaluate the impact before you call this operation.
Debugging
Request syntax
POST /clusters/cluster_id/components/component_id/config HTTP/1.1
Content-Type:application/json
{
"config" : "String"
}
Request parameters
| Parameter | Type | Required | Example | Description |
| cluster_id | String | Yes | c71d616e629ff40d5b42d7bb87770**** | The ID of the cluster. |
| component_id | String | Yes | coredns | The ID of the component. |
| Parameter | Type | Required | Example | Description |
| config | String | No | {"CpuRequest":"800m"} | The custom parameter settings that you want to use. |
Set config to a JSON string.
Response syntax
HTTP/1.1 200 OK
Response parameters
Modify the configurations of a component
The following example shows how to modify the parameters of CoreDNS:
POST /clusters/c71d616e629ff40d5b42d7bb87770****/components/coredns/config HTTP/1.1
Host:cs.aliyuncs.com
Content-Type:application/json
{
"config" : "{\"CpuRequest\":\"800m\"}"
}
Sample success responses
JSON format
HTTP/1.1 200 OK
Modify the parameters of a control plane component in an ACK Pro cluster
The following example shows how to modify the parameters of kube-apiserver in an ACK Pro cluster:
POST /clusters/c71d616e629ff40d5b42d7bb87770****/components/kube-apiserver/config HTTP/1.1
Host:cs.aliyuncs.com
Content-Type:application/json
{
"config":"{\"maxRequestsInflight\":\"100\",\"requestTimeout\":\"30s\"}"
}
Sample success responses
JSON format
HTTP/1.1 200 OK
Error codes
For a list of error codes, see Service error codes.