[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-03。"],[],[],null,["# Rotate your cluster's security keys\n\nKey Rotation\n------------\n\nKey rotation is the act of changing the\nunderlying cryptographic material contained in a *key encryption key (KEK)*. It\ncan be triggered\nautomatically as part of a scheduled rotation, or\nmanually,\nusually after a security incident where keys might have been compromised. Key\nrotation replaces only the single field in the key that contains the raw\nencryption/decryption key data.\n\n### Automatic Key Rotation\n\nThe AWS Key Management Service (KMS) supports\n[automatic rotation of KMS keys](https://docs.aws.amazon.com/kms/latest/developerguide/rotate-keys.html).\nWhen enabled, AWS automatically generates new cryptographic key material for\nyour key once a year. No manual actions are required.\n\nAfter a key rotation, GKE on AWS encrypts each new Secret with the\nnew key. Any previously-created Secret is still decrypted with its original key.\nFor this reason, AWS keeps CMK's older key material in perpetuity, allowing old\nDEKs to be decrypted when old Secrets are read.\n\nYou can see whether a KMS key has automatic rotation enabled or not with\nthe following command: \n\n aws kms get-key-rotation --key-id \u003cvar translate=\"no\"\u003eKMS_KEY_ID\u003c/var\u003e\n\nReplace \u003cvar translate=\"no\"\u003eKMS_KEY_ID\u003c/var\u003e with your AWS KMS key ID.\n\nYou can enable automatic key rotation by running this command: \n\n aws kms enable-key-rotation --key-id KMS_KEY_ID\n\n### Manual Key Rotation\n\nThis section explains how to manually rotate your control plane or node pool\nconfiguration keys.\n\n### Control plane configuration key\n\nTo manually rotate your\n[control plane configuration](/sdk/gcloud/reference/container/aws/clusters/create#--config-encryption-kms-key-arn)\nkey, perform the following steps:\n\n1. [Create a new Cloud Key Management Service key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html).\n Save the value of your KMS key ARN. You'll use it later.\n\n2. Ensure the IAM role associated with the cluster has permissions\n to encrypt and decrypt using the new key.\n\n3. Use the\n [`gcloud container aws clusters update`](/sdk/gcloud/reference/container/aws/clusters/update)\n command to update the encryption key.\n\n gcloud container aws clusters update \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e \\\n --config-encryption-kms-key-arn=\u003cvar translate=\"no\"\u003eCONFIG_ENCRYPTION_KMS_KEY_ARN\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: your cluster's name\n - \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e: the [supported Google Cloud region](/kubernetes-engine/multi-cloud/docs/aws/reference/supported-regions) that manages your cluster---for example, `us-west1`\n - \u003cvar translate=\"no\"\u003eCONFIG_ENCRYPTION_KMS_KEY_ARN\u003c/var\u003e: your new KMS key ARN\n\n### Control plane root volume\n\nTo manually rotate your\n[control plane root volume](/sdk/gcloud/reference/container/aws/clusters/create#--root-volume-kms-key-arn)\nkey, perform the following steps:\n\n1. [Create a new Cloud Key Management Service key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html).\n Save the value of your KMS key ARN. You'll use it later.\n\n2. Ensure the IAM role associated with the cluster has permissions\n to encrypt and decrypt using the new key.\n\n3. Use the\n [`gcloud container aws clusters update`](/sdk/gcloud/reference/container/aws/clusters/update)\n command to update the encryption key.\n\n gcloud container aws clusters update \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e \\\n --location=\u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e \\\n --root-volume-kms-key-arn=\u003cvar translate=\"no\"\u003eROOT_VOLUME_KMS_KEY_ARN\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eCLUSTER_NAME\u003c/var\u003e: your cluster's name\n - \u003cvar translate=\"no\"\u003eGOOGLE_CLOUD_LOCATION\u003c/var\u003e: the [supported Google Cloud region](/kubernetes-engine/multi-cloud/docs/aws/reference/supported-regions) that manages your cluster---for example, `us-west1`\n - \u003cvar translate=\"no\"\u003eROOT_VOLUME_KMS_KEY_ARN\u003c/var\u003e: Amazon Resource Name (ARN) of the AWS KMS key to encrypt the root volume\n\n### Node pool configuration key\n\nTo manually rotate your\n[Node pool configuration](/sdk/gcloud/reference/container/aws/node-pools/create#--config-encryption-kms-key-arn)\nkey, perform the following steps:\n\n1. [Create a new Cloud Key Management Service key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html).\n\n2. Ensure the IAM role associated with the cluster has permissions\n to encrypt and decrypt using the new key.\n\n3. Update the KMS alias in use:\n\n aws kms update-alias --alias-name \u003cvar translate=\"no\"\u003eKEY_ALIAS\u003c/var\u003e \\\n --target-key-id \u003cvar translate=\"no\"\u003eCONFIG_ENCRYPTION_KMS_KEY_ARN\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eKEY_ALIAS\u003c/var\u003e: your existing key's alias\n - \u003cvar translate=\"no\"\u003eCONFIG_ENCRYPTION_KMS_KEY_ARN\u003c/var\u003e: your new KMS key ARN\n4. Force the cluster to re-encrypt all cluster Secrets using the new\n encryption key:\n\n kubectl get secrets --all-namespaces -o json | \\\n kubectl annotate --overwrite -f - encryption-key-rotation-time=`date +\"%Y%m%d-%H%M%S\"`\n\n5. Disable the old AWS KMS key. For more information, see\n [Enabling and disabling keys](https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html).\n\n### Node pool root volumes\n\nTo manually rotate your\n[Node pool root volume](/sdk/gcloud/reference/container/aws/node-pools/create#--root-volume-kms-key-arn)\nkey, perform the following steps:\n\n1. [Create a new Cloud Key Management Service key](https://docs.aws.amazon.com/kms/latest/developerguide/create-keys.html).\n\n2. Ensure the IAM role associated with the cluster has permissions\n to encrypt and decrypt using the new key.\n\n3. Update the KMS alias in use:\n\n aws kms update-alias --alias-name \u003cvar translate=\"no\"\u003eKEY_ALIAS\u003c/var\u003e \\\n --target-key-id \u003cvar translate=\"no\"\u003eROOT_VOLUME_KMS_KEY_ARN\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eKEY_ALIAS\u003c/var\u003e: your existing key's alias\n - \u003cvar translate=\"no\"\u003eROOT_ENCRYPTION_KMS_KEY_ARN\u003c/var\u003e: your new KMS key ARN\n4. Update your node pool:\n\n gcloud container aws node-pools update \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e \\\n --root-volume-kms-key-arn=\u003cvar translate=\"no\"\u003eROOT_VOLUME_KMS_KEY_ARN\u003c/var\u003e\n\n Replace the following:\n - \u003cvar translate=\"no\"\u003eNODE_POOL_NAME\u003c/var\u003e: name of your node pool\n - \u003cvar translate=\"no\"\u003eROOT_VOLUME_KMS_KEY_ARN\u003c/var\u003e: Amazon Resource Name (ARN) of the AWS KMS key to encrypt the root volume\n5. Disable the old AWS KMS key. For more information, see\n [Enabling and disabling keys](https://docs.aws.amazon.com/kms/latest/developerguide/enabling-keys.html)."]]