ModifyCluster

Updated at: 2025-02-10 08:56

You can call the ModifyCluster operation to modify the cluster configurations by cluster ID.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • For mandatory resource types, indicate with a prefix of * .
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
OperationAccess levelResource typeCondition keyAssociated operation
cs:ModifyClusterupdate
*Cluster
acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}
  • cs:EnableApiServerEip
  • cs:ApiServerEipId
none

Request syntax

PUT /api/v2/clusters/{ClusterId} HTTP/1.1

Request parameters

ParameterTypeRequiredDescriptionExample
ParameterTypeRequiredDescriptionExample
ClusterIdstringYes

The cluster ID.

cb95aa626a47740afbf6aa099b65****
bodyobjectNo

The request body parameters.

api_server_eipbooleanNo

Specifies whether to associate an elastic IP address (EIP) with the cluster. This EIP is used to enable access to the API server over the Internet. Valid values:

  • true: associates an EIP with the cluster.
  • false: does not associate an EIP with the cluster.
true
api_server_eip_idstringNo

The ID of the EIP that you want to associate with the API server of the cluster. This parameter takes effect when api_server_eip is set to true.

eip-wz9fnasl6dsfhmvci****
deletion_protectionbooleanNo

Specifies whether to enable cluster deletion protection. If you enable this option, the cluster cannot be deleted in the console or by calling API operations. Valid values:

  • true: enables cluster deletion protection.
  • false: disables cluster deletion protection.

Default value: false.

true
instance_deletion_protectionbooleanNo

Specifies whether to enable instance deletion protection. If you enable this option, the instance cannot be deleted in the console or by calling API operations. Valid values:

  • true: enables instance deletion protection.
  • false: disables instance deletion protection.

Default value: false.

true
ingress_domain_rebindingstringNo

Specifies whether to remap the test domain name of the cluster. Valid values:

  • true: remaps the test domain name of the cluster.
  • false: does not remap the test domain name of the cluster.

Default value: false.

true
ingress_loadbalancer_idstringNo

The ID of the Server Load Balancer (SLB) instance of the cluster to be modified.

lb-wz97kes8tnndkpodw****
resource_group_idstringNo

The resource group ID of the cluster.

rg-acfmyvw3wjm****
maintenance_windowmaintenance_windowNo

The cluster maintenance window. This feature takes effect only for ACK Pro clusters.

enable_rrsabooleanNo

Specifies whether to enable the RAM Roles for Service Accounts (RRSA) feature. This parameter is available only for ACK managed clusters. Valid values:

  • true: enables the RRSA feature.
  • false: disables the RRSA feature.
true
access_control_listarrayNo

The network access control list (ACL) of the SLB instance associated with the API server if the cluster is a registered cluster.

stringNo

The ACL of the SLB instance associated with the API server if the cluster is a registered cluster.

Note: Do not specify the 0.0.0.0/0 CIDR block.

192.168.1.0/24
cluster_namestringNo

The name of the cluster.

The cluster name must be 1 to 63 characters in length, and can contain digits, letters, and hyphens (-). The cluster name cannot start with a hyphen (-).

cluster-new-name
system_events_loggingobjectNo

The storage configurations of system events.

enabledbooleanNo

Specifies whether to enable system event storage.

true
logging_projectstringNo

The name of the Simple Log Service project that stores system events.

k8s-log-cb95aa626a47740afbf6aa099b65****
operation_policyobjectNo

The automatic O&M policy of the cluster.

cluster_auto_upgradeobjectNo

The configurations of automatic update.

enabledbooleanNo

Specifies whether to enable automatic update.

true
channelstringNo

The frequency of automatic cluster updates. For more information, see Update frequency.

Valid values:

  • patch: the latest patch version.
  • stables: the second-latest minor version.
  • rapid: the latest minor version.
patch
api_server_custom_cert_sansobjectNo

The custom subject alternative names (SANs) for the API server certificate to accept requests from specified IP addresses or domain names. This parameter is available only for ACK managed clusters.

actionstringNo

Specifies whether to overwrite or add SANs. Valid values:

  • overwrite: overwrites SANs.
  • append: adds SANs.
append
subject_alternative_namesarrayNo

The list of SANs.

stringNo

The SAN.

192.168.0.119
vswitch_idsarrayNo

The vSwitches of the control plane. This parameter can be used to change the vSwitches of the control plane in an ACK managed cluster. Take note of the following items:

  • This parameter overwrites the existing configuration. You must specify all vSwitches of the control plane.
  • The control plane restarts during the change process. Exercise caution when you perform this operation.
  • Ensure that all security groups of the cluster, including the security groups of the control plane, all node pools, and container network, are allowed to access the CIDR blocks of the new vSwitches. This ensures that the nodes and containers can connect to the API server.
  • If the new vSwitches of the control plane are configured with an ACL, ensure that the ACL allows communication between the new vSwitches and CIDR blocks such as those of the cluster nodes and the container network.
stringNo

The vSwitches of the control plane.

vsw-2ze4jvvvade1yk899****
control_plane_configobjectNo

The control plane configurations of an ACK dedicated cluster.

charge_typestringNo

The billing method of the instance. Valid values:

  • PrePaid: subscription.
  • PostPaid: pay-as-you-go.

Default value: PostPaid.

PrePaid
periodlongNo

The subscription duration of the instance. This parameter takes effect and is required only when charge_type is set to PrePaid.

If PeriodUnit=Month is specified, the valid values are 1, 2, 3, 6, 12, 24, 36, 48, and 60.

1
period_unitstringNo

The billing cycle of the instance. This parameter takes effect only when instance_charge_type is set to PrePaid.

Valid value: Month.

Month
auto_renewbooleanNo

Specifies whether to enable auto-renewal for the instance. This parameter takes effect only when charge_type is set to PrePaid. Valid values:

  • true: enables auto-renewal.
  • false: disables auto-renewal.

Default value: false.

true
auto_renew_periodlongNo

The auto-renewal period of the instance. Valid values: 1, 2, 3, 6, and 12.

Default value: 1.

1
instance_typesarrayNo

The instance type. For more information, see Overview of ECS instance families.

stringNo

The instance type.

ecs.g6.large
image_typestringNo

The type of the OS image. Valid values:

  • AliyunLinux3: Alibaba Cloud Linux 3.
  • Custom: the custom image.
AliyunLinux3
image_idstringNo

The custom image ID. You must configure this parameter if you use a custom image.

aliyun_3_x64_20G_alibase_20240819.vhd
key_pairstringNo

The name of the key pair. You must configure either this parameter or the login_password parameter.

ack
login_passwordstringNo

The password for SSH logon. You must configure either this parameter or the key_pair parameter. The password must be 8 to 30 characters in length, and must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special characters. To log on with a password, you must specify this parameter during the scale-out.

Ack@2000.
system_disk_categorystringNo

The type of the node system disk. Valid values:

  • cloud: basic disk.
  • cloud_efficiency: ultra disk.
  • cloud_ssd: standard SSD.
  • cloud_essd: enhanced SSD (ESSD).
  • cloud_auto: ESSD AutoPL disk.
  • cloud_essd_entry: ESSD Entry disk.
cloud_essd
system_disk_sizelongNo

The type of the system disk. Valid values: [40,500]. Unit: GiB.

120
system_disk_snapshot_policy_idstringNo

The ID of the automatic snapshot policy applied to the node system disk.

sp-2zej1nogjvovnz4z****
system_disk_performance_levelstringNo

The performance level (PL) of the system disk that you want to use for the node. This parameter is effective only for ESSDs. This parameter is related to the disk size. For more information, see ESSDs .

PL1
system_disk_provisioned_iopslongNo

The preset read/write input/output operations per second (IOPS) of the system disk. Valid values: 0 to min{50,000, 1,000 × Capacity - Baseline IOPS} Baseline IOPS = min{1,800 + 50 × Capacity, 50,000}.

This parameter is effective only when system_disk_category is set to cloud_auto. For more information, see ESSD AutoPL disks.

1000
system_disk_bursting_enabledbooleanNo

Specifies whether to enable the burst feature for the system disk. Valid values:

  • true: enables the burst feature.
  • false: disables the burst feature.

This parameter is effective only when system_disk_category is set to cloud_auto. For more information, see ESSD AutoPL disks.

true
deploymentset_idstringNo

The ID of the deployment set.

ds-bp10b35imuam5amw****
cloud_monitor_flagsbooleanNo

Specifies whether to install the CloudMonitor agent. Valid values:

  • true: installs the CloudMonitor agent.
  • false: does not install the CloudMonitor agent.
true
soc_enabledbooleanNo

Specifies whether to enable Multi-Level Protection Scheme (MLPS) security hardening. For more information, see ACK security hardening based on MLPS.

Valid values:

  • true: enables MLPS security hardening.
  • false: disables MLPS security hardening.

Default value: false.

false
security_hardening_osbooleanNo

Specifies whether to enable Alibaba Cloud Linux Security Hardening. Valid values:

  • true: enables Alibaba Cloud Linux Security Hardening.
  • false: disables Alibaba Cloud Linux Security Hardening.

Default value: false.

true
cpu_policystringNo

The CPU management policy of nodes in the node pool. The following policies are supported if the Kubernetes version of the cluster is 1.12.6 or later:

  • static: allows pods with specific resource characteristics on the node to be granted with enhanced CPU affinity and exclusivity.
  • none: specifies that the default CPU affinity is used.

Default value: none.

none
runtimestringNo

The type of the container runtime. Valid values:

  • containerd: supports all Kubernetes versions. We recommend that you set the parameter to this value.

Default value: containerd.

containerd
node_port_rangestringNo

The node port range.

30000-32767
sizelongNo

The number of control plane nodes. If you want to scale out the control plane in an ACK dedicated cluster, set this parameter to the desired number of nodes. This parameter must be greater than the current number of nodes.

5

Response parameters

ParameterTypeDescriptionExample
ParameterTypeDescriptionExample
object

The returned data.

cluster_idstring

The cluster ID.

cb95aa626a47740afbf6aa09****
request_idstring

The request ID.

687C5BAA-D103-4993-884B-C35E4314****
task_idstring

The task ID.

T-5a54309c80282e39ea00****

Examples

Sample success responses

JSONformat

{
  "cluster_id": "cb95aa626a47740afbf6aa09****",
  "request_id": "687C5BAA-D103-4993-884B-C35E4314****",
  "task_id": "T-5a54309c80282e39ea00****"
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
Change timeSummary of changesOperation
2024-11-19The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-10-18The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-04-24The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-01-11The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-10-18The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-10-10The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-08-21The internal configuration of the API is changed, but the call is not affectedView Change Details
2023-08-18The internal configuration of the API is changed, but the call is not affectedView Change Details
  • On this page (1)
  • Debugging
  • Authorization information
  • Request syntax
  • Request parameters
  • Response parameters
  • Examples
  • Error codes
  • Change history
Feedback
phone Contact Us

Chat now with Alibaba Cloud Customer Service to assist you in finding the right products and services to meet your needs.

alicare alicarealicarealicare