Google Distributed Cloud version 1.9 supports encrypting secrets without the need for an external KMS (Key Management Service), or any other dependencies.
Enable always-on secrets encryption
Always-on secrets encryption works by automatically generating an encryption key that is used to encrypt secrets before they are stored on the etcd database for that cluster.
The key version is a version number to indicate the key currently in use.
You can enable secrets encryption after a cluster has already been created.
ADMIN_KUBECONFIG with the path of your admin cluster kubeconfig file.
ADMIN_CLUSTER_CONFIG with the path of your admin cluster configuration file.
USER_CLUSTER_CONFIG with the path of your user cluster configuration file.
The gkectl update commands provided in this section can also be used for any other updates to the corresponding cluster.
Key storage
The encryption keys for the admin cluster are stored on the admin cluster data disk. This disk is mounted on the admin master machine at /opt/data, and the encryption keys can be found at /opt/data/gke-k8s-kms-plugin/generatedkeys/. These keys must be backed up to retain access to the encrypted secrets used by that key.
Key rotation
To rotate an existing encryption key for a cluster, increment the keyVersion in the corresponding admin cluster configuration file or user cluster configuration file, and run the appropriate gkectl update command. This creates a new key matching the new version number, re-encrypts each secret, and securely erases the old one. All subsequent new secrets are encrypted using the new encryption key.
Disable always-on secrets encryption
To disable secrets encryption on an existing cluster, remove the keyVersion field and add a disabled: true field. Next, run the corresponding gkectl update command. This update decrypts each existing secret and stores each secret in plain text. All subsequent new secrets are stored in plain text.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-25 UTC."],[[["\u003cp\u003eGoogle Distributed Cloud version 1.9 enables the encryption of secrets without external dependencies by automatically generating an encryption key before storing them in the cluster's etcd database.\u003c/p\u003e\n"],["\u003cp\u003eSecrets encryption can be enabled on existing clusters, both admin and user, by adding a \u003ccode\u003esecretsEncryption\u003c/code\u003e section to the respective cluster configuration file and using the \u003ccode\u003egkectl update\u003c/code\u003e command.\u003c/p\u003e\n"],["\u003cp\u003eThe encryption key's version is indicated by a \u003ccode\u003ekeyVersion\u003c/code\u003e number, which is used to manage key rotation, creating new keys, and re-encrypting secrets.\u003c/p\u003e\n"],["\u003cp\u003eEncryption keys for the admin cluster are stored on the admin cluster's data disk at \u003ccode\u003e/opt/data/gke-k8s-kms-plugin/generatedkeys/\u003c/code\u003e, and these keys must be backed up to ensure continued access to encrypted secrets.\u003c/p\u003e\n"],["\u003cp\u003eSecrets encryption can be disabled on a cluster by removing the \u003ccode\u003ekeyVersion\u003c/code\u003e field and setting \u003ccode\u003edisabled: true\u003c/code\u003e, which decrypts existing secrets and stores new ones in plain text.\u003c/p\u003e\n"]]],[],null,["# Using always-on secrets encryption\n\n\u003cbr /\u003e\n\nGoogle Distributed Cloud version 1.9 supports encrypting secrets without the need for an external KMS (Key Management Service), or any other dependencies.\n\nEnable always-on secrets encryption\n-----------------------------------\n\nAlways-on secrets encryption works by automatically generating an encryption key that is used to encrypt secrets before they are stored on the etcd database for that cluster.\n\nThe key version is a version number to indicate the key currently in use.\n\nYou can enable secrets encryption after a cluster has already been created.\n\n- For the admin cluster:\n\n 1. Edit the [admin cluster configuration file](/anthos/clusters/docs/on-prem/1.9/how-to/admin-cluster-configuration-file#secretsencryption-section) to add the `secretsEncryption` section.\n\n 2. Run the `gkectl update` command.\n\n ```\n gkectl update admin --config ADMIN_CLUSTER_CONFIG_FILE --kubeconfig ADMIN_CLUSTER_KUBECONFIG\n ```\n- For a user cluster:\n\n 1. Edit the [user cluster configuration file](/anthos/clusters/docs/on-prem/1.9/how-to/user-cluster-configuration-file#secretsencryption-section) to add the `secretsEncryption` section.\n\n 2. Run the `gkectl update` command.\n\n ```\n gkectl update cluster --config USER_CONFIG_FILE --kubeconfig ADMIN_CLUSTER_KUBECONFIG\n ```\n\nReplace the following:\n\n- `ADMIN_KUBECONFIG` with the path of your admin cluster kubeconfig file.\n- `ADMIN_CLUSTER_CONFIG` with the path of your admin cluster configuration file.\n- `USER_CLUSTER_CONFIG` with the path of your user cluster configuration file.\n\nThe `gkectl update` commands provided in this section can also be used for any other updates to the corresponding cluster.\n\nKey storage\n-----------\n\nThe encryption keys for the admin cluster are stored on the admin cluster data disk. This disk is mounted on the admin master machine at `/opt/data`, and the encryption keys can be found at `/opt/data/gke-k8s-kms-plugin/generatedkeys/`. These keys must be backed up to retain access to the encrypted secrets used by that key.\n\nKey rotation\n------------\n\nTo rotate an existing encryption key for a cluster, increment the `keyVersion` in the corresponding [admin cluster configuration file](/anthos/clusters/docs/on-prem/1.9/how-to/admin-cluster-configuration-file#secretsencryption-generatedkey-version-field) or [user cluster configuration file](/anthos/clusters/docs/on-prem/1.9/how-to/user-cluster-configuration-file#secretsencryption-generatedkey-version-field), and run the appropriate `gkectl update` command. This creates a new key matching the new version number, re-encrypts each secret, and securely erases the old one. All subsequent new secrets are encrypted using the new encryption key.\n\nDisable always-on secrets encryption\n------------------------------------\n\nTo disable secrets encryption on an existing cluster, remove the `keyVersion` field and add a `disabled: true` field. Next, run the corresponding `gkectl update` command. This update decrypts each existing secret and stores each secret in plain text. All subsequent new secrets are stored in plain text.\n\n```\nsecretsEncryption:\n mode: GeneratedKey\n generatedKey:\n disabled: true\n```"]]