-
Notifications
You must be signed in to change notification settings - Fork 99
Updated credentials rotation topic #1004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -13,71 +13,61 @@ next: false | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| local: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| --- | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Credential Rotation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Overview | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Keys | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Gardener deals with two distinct classes of credentials for Shoot clusters. They differ in scope, ownership, and how they are rotated: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| There are plenty of keys in Gardener. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The ETCD needs one to store resources like secrets encrypted at rest. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Gardener generates certificate authorities (CAs) to ensure secured communication between the various components and actors and service account tokens are signed with a dedicated key. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| There is also an SSH key pair to allow debugging of nodes and the observability stack has its own passwords too. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Class | Examples | Scope | Who rotates | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |---|---|---|---| | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | **Infrastructure credentials** | Cloud provider keys (AWS, Azure, GCP, OpenStack) | Project-scoped — shared across Shoots via `CredentialsBinding` | You | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | **Shoot credentials** | CAs, SSH key pair, ETCD encryption key, ServiceAccount signing key, observability passwords | Per-Shoot — generated and managed by Gardener | You, via `kubectl annotate` operations on the Shoot | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Infrastructure credentials are **not** part of the Shoot itself — they are `Secret`s in the garden cluster's project namespace, referenced by Shoots via a `CredentialsBinding`. Shoot credentials are generated per Shoot by Gardener and rotate through well-defined phases. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| All of these keys share a common property: they are managed by Gardener. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Rotating them, however, is potentially very disruptive. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Hence, Gardener does not do it automatically, but offers you means to perform these tasks easily. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For a single cluster, you may conveniently use the dashboard. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For step-by-step instructions, go directly to the relevant section in the [Credentials Rotation for Shoot Clusters](https://github.com/gardener/gardener/blob/master/docs/usage/shoot-operations/shoot_credentials_rotation.md) documentation: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - [Infrastructure credentials](https://github.com/gardener/gardener/blob/master/docs/usage/shoot-operations/shoot_credentials_rotation.md#infrastructure-credentials-project-scoped) (cloud provider keys) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - [Shoot credentials](https://github.com/gardener/gardener/blob/master/docs/usage/shoot-operations/shoot_credentials_rotation.md#shoot-credentials-gardener-managed) (CAs, SSH, ETCD, etc.) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Two-Phase Rotation Model | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Where possible, the rotation happens in two phases - Preparing and Completing. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For Gardener-managed credentials, rotation happens in two phases where possible. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Prepare Rotation of All Credentials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The Preparing phase introduces new keys while the old ones are still valid. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Users can safely exchange keys / CA bundles wherever they are used. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| It is possible to start the preparation by annotating the shoot resource accordingly: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| In the **Preparing phase**, new credentials are created alongside the old ones — both sets are valid simultaneously. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This gives you time to update any API clients, kubeconfigs, or tooling that depend on the old credentials before they are invalidated. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kubectl -n <shoot-namespace> annotate shoot <shoot-name> gardener.cloud/operation=rotate-credentials-start | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| In the **Completing phase**, the old credentials are invalidated and only the new set remains. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You should only trigger this phase after all clients have been updated to use the new credentials. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ### Complete Rotation of All Credentials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The shoot's status always reflects the current rotation phase, readable at `.status.credentials.rotation`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+31
to
+43
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Add readiness checks and failure consequences to the two-phase workflow. The page tells users to update clients before completing rotation, but does not identify how to verify readiness, what happens if a client is missed, or how to recover from a failed completion. This is especially risky for CA and kubeconfig consumers, where premature completion can break access. Suggested addition In the **Completing phase**, the old credentials are invalidated and only the new set remains.
You should only trigger this phase after all clients have been updated to use the new credentials.
+Before completing, verify every affected client and confirm the rotation status is ready.
+If any client still uses the old credentials, it may lose access after completion; document the
+recovery procedure and whether another rotation is required.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Afterward, the Completing phase will invalidate the old keys / CA bundles. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Annotate the shoot resource accordingly: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You can also conveniently trigger rotation from the Gardener dashboard: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ```bash | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| kubectl -n <shoot-namespace> annotate shoot <shoot-name> gardener.cloud/operation=rotate-credentials-complete | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ``` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Rotation Phases | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Automatic Rotation | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Some Gardener-managed credential types support automatic rotation during the maintenance window via `.spec.maintenance.autoRotation.credentials`: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| At the beginning, only the old set of credentials exists. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| By triggering the rotation, new credentials are created in the Preparing phase and both sets are valid. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Now, all clients have to update and start using the new credentials. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Only afterward it is safe to trigger the Completing phase, which invalidates the old credentials. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - SSH key pair | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - ETCD encryption key (enabled by default on new shoots) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - Observability passwords | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| The shoot's status will always show the current status / phase of the rotation. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Certificate authorities and the ServiceAccount signing key require user action between phases and therefore cannot be rotated automatically. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+49
to
+57
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win Document credential types that cannot be rotated. The automatic-rotation list omits the OpenVPN TLS auth key, which the detailed guide identifies as not rotatable manually or automatically. Explicitly distinguish manual-only credentials from credentials that cannot be rotated at all, so users do not search for or attempt an unavailable procedure. 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For more information, see [Credentials Rotation for Shoot Clusters](/docs/gardener/shoot-operations/shoot_credentials_rotation/). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For configuration details, see [Automatic Credentials Rotation](https://github.com/gardener/gardener/blob/master/docs/usage/shoot/shoot_maintenance.md#automatic-credentials-rotation). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## User-Provided Credentials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ## Infrastructure Credentials | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| You grant Gardener permissions to create resources by handing over cloud provider keys. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| These keys are stored in a secret and referenced to a shoot via a SecretBinding. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Gardener uses the keys to create the network for the cluster resources, routes, VMs, disks, and IP addresses. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Infrastructure credentials are cloud provider keys you supply to Gardener so it can manage your cluster's infrastructure (networks, VMs, disks, load balancers). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| These keys are stored in a `Secret` in the garden cluster's project namespace and referenced by your Shoot via a `CredentialsBinding`. A single `Secret` can be shared across multiple Shoots. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| When you rotate credentials, the new keys have to be stored in the same secret and the shoot needs to reconcile successfully to ensure the replication to every controller. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Afterward, the old keys can be deleted safely from Gardener's perspective. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| While the reconciliation can be triggered manually, there is no need for it (if you're not in a hurry). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Each shoot reconciles once within 24h and the new keys will be picked up during the next maintenance window. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| When you rotate these credentials, you update the `Secret` with new keys, wait for all Shoots referencing that `Secret` to reconcile successfully, and only then deactivate the old keys in your cloud provider account. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+61
to
+68
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win Add verification and failure handling for shared infrastructure credentials. The instruction to “wait for all Shoots” is not actionable enough. Provide the expected reconciliation/status checks, timing expectations, and a procedure for handling one Shoot that fails to reconcile. Because the 🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > [!NOTE] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > It is not possible to move a shoot to a different infrastructure account (at all!). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| > It is not possible to move a Shoot to a different infrastructure account. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| For the full rotation procedure, see [Infrastructure Credentials (Project-Scoped)](https://github.com/gardener/gardener/blob/master/docs/usage/shoot-operations/shoot_credentials_rotation.md#infrastructure-credentials-project-scoped) in the Credentials Rotation guide. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Clarify user versus Gardener responsibilities.
“Who rotates: You” and “You, via
kubectl annotate” can imply that users perform the rotation mechanics. State explicitly that users choose the timing, update dependent clients, and trigger completion, while Gardener creates, distributes, and invalidates Gardener-managed credentials. Add a short decision guide for choosing between the two workflows.🤖 Prompt for AI Agents