All Products
Search
Document Center

Container Service for Kubernetes:UpdateKMSEncryption

Last Updated:Aug 28, 2026

Update the configuration of the Secret-at-rest encryption feature for a specified cluster by cluster ID.

Operation description

  • 开启或关闭落盘加密功能的过程中以及成功开启该功能后,请勿使用 KMS 控制台或 OpenAPI 禁用或删除该功能所使用的 KMS 密钥,否则会导致集群 API Server 不可用,继而无法正常获取 Secret 和 ServiceAccount 等对象,影响业务应用的正常运行。更多信息,请参见使用阿里云 KMS 进行 Secret 的落盘加密

  • 调用该 API 的用户或角色需要额外被授予所需的集群 RBAC 权限(需要被授予运维人员或管理员权限),否则将返回“ForbiddenUpdateKMSState”错误码。

  • 成功调用该 API 后,集群状态将被变更为“更新中”,待变更完成后集群状态将恢复为“运行中”。针对同一个集群的变更完成后,需要间隔 5 分钟以上才能再次调用该 API,否则将返回“409”状态码。

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cs:UpdateKMSEncryption

none

*Cluster

acs:cs:{#regionId}:{#accountId}:cluster/{#ClusterId}

None None

Request syntax

PUT /clusters/{ClusterId}/kms HTTP/1.1

Path Parameters

Parameter

Type

Required

Description

Example

ClusterId

string

Yes

The cluster ID.

c4fe1e3a721544***

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

Request body parameters.

kms_key_id

string

No

The KMS key ID used by the Secret-at-rest encryption feature.

Important You cannot use a service key. You must use either a master key or a customer master key. The key type must be Aliyun_AES_256, and the key usage must be ENCRYPT/DECRYPT.
Warning During the process of enabling or disabling the at-rest encryption feature and after the feature is successfully enabled, do not disable or delete the KMS key via the KMS console or OpenAPI. Otherwise, the cluster API Server will become unavailable, preventing normal retrieval of objects such as Secrets and ServiceAccounts, which impacts the normal operation of business applications.

key-abc***

disable_encryption

boolean

No

Specifies whether to disable the Secret-at-rest encryption feature.

  • true: Disables the at-rest encryption feature.

  • false: Enables the at-rest encryption feature.

false

Response elements

Element

Type

Description

Example

None defined.

Examples

Success response

JSON format

{}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.