Skip to content

KEP-5943: Topology For Volume Snapshots#5944

Open
mdzraf wants to merge 3 commits intokubernetes:masterfrom
mdzraf:SnapshotTopologyKepInitialPublish
Open

KEP-5943: Topology For Volume Snapshots#5944
mdzraf wants to merge 3 commits intokubernetes:masterfrom
mdzraf:SnapshotTopologyKepInitialPublish

Conversation

@mdzraf
Copy link
Copy Markdown
Member

@mdzraf mdzraf commented Mar 3, 2026

  • One-line PR description: This PR adds a new KEP for Adding Topology Support for Snapshots
  • Other comments:

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory labels Mar 3, 2026
@k8s-ci-robot k8s-ci-robot added sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 3, 2026
@mdzraf mdzraf mentioned this pull request Mar 3, 2026
4 tasks
@mdzraf mdzraf force-pushed the SnapshotTopologyKepInitialPublish branch from a89a2eb to cc5ad00 Compare March 3, 2026 19:54
- Implementing cross region/AZ snapshot cloning functionality.
- Add ability to modify any existing volume snapshot fields.
- Modifying the in-tree kube-scheduler or adding snapshot CRD dependencies to core Kubernetes components.
- Topology enforcement for `Immediate` volume binding mode.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does volume binding mode mean for a snapshot?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This more refers to the StorageClass's volume binding mode on the PVC being restored, not a property of the snapshot itself. Made the description more clear in the new rev.

Topology enforcement when restoring a snapshot to a PVC whose StorageClass uses `Immediate` volume binding mode (topology enforcement only applies to `WaitForFirstConsumer`).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with Immediate binding mode, couldn't we still look at the dataSource's topology?

Copy link
Copy Markdown
Member Author

@mdzraf mdzraf Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even with Immediate binding mode, couldn't we still look at the dataSource's topology?

I thought about this but decided against it for consistency with how Immediate binding mode works today, where PersistentVolumes are bound or provisioned without knowledge of the Pod's scheduling requirements. By choosing Immediate, the administrator is already acknowledging this can result in unschedulable pods, and the documented recommendation to avoid that is to use WaitForFirstConsumer. Treating snapshot-sourced PVCs differently would be inconsistent with that existing contract. Happy to revisit this if you think there is a reason to figure out a mechanism to enforce topology on immediate binding mode.

Comment thread keps/sig-storage/5943-topology-for-volume-snapshot/README.md Outdated

The scheduler's built-in `volumebinding` plugin has no awareness of snapshot topology today. It only considers the StorageClass's `allowedTopologies` and the node's own constraints. This means it can select a node in `foo-bar-1` even though the snapshot source is only accessible from `foo-bar-2`.

Attempting to solve this at the provisioner level (e.g., in the external-provisioner) would only allow us to fail after the scheduler has already made its decision. The provisioner could reject the request and trigger a reschedule, but this creates a retry loop: the scheduler picks a node, provisioning fails, the scheduler picks another node, and so on with no guarantee of convergence.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than a new scheduler plugin, do we still need to make changes in the external-provisioner?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since by the point that we get past the scheduler plugin we have already selected a node and the provisioner already derives the topology from the compatible selected node, there is no need to changes to the external-provisioner as the existing behavior will continue to work.

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. labels Apr 7, 2026
@k8s-ci-robot k8s-ci-robot added the sig/multicluster Categorizes an issue or PR as relevant to SIG Multicluster. label Apr 7, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in SIG Apps Apr 7, 2026
@k8s-ci-robot k8s-ci-robot added sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/windows Categorizes an issue or PR as relevant to SIG Windows. labels Apr 7, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in SIG Scheduling Apr 7, 2026
@mdzraf mdzraf force-pushed the SnapshotTopologyKepInitialPublish branch from 5de6d69 to 7c0348e Compare April 7, 2026 12:13
@mdzraf
Copy link
Copy Markdown
Member Author

mdzraf commented Apr 7, 2026

/remove-sig apps
/remove-sig auth
/remove-sig multicluster
/remove-sig api-machinery
/remove-sig node
/remove-sig scheduling
/remove-sig windows

@k8s-ci-robot k8s-ci-robot removed sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/multicluster Categorizes an issue or PR as relevant to SIG Multicluster. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/node Categorizes an issue or PR as relevant to SIG Node. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. sig/windows Categorizes an issue or PR as relevant to SIG Windows. labels Apr 7, 2026
@mdzraf
Copy link
Copy Markdown
Member Author

mdzraf commented Apr 7, 2026

/assign @msau42

// This field is immutable.
// +optional
// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="accessibleTopology is immutable"
AccessibleTopology []TopologySegment `json:"accessibleTopology,omitempty" protobuf:"bytes,7,rep,name=accessibleTopology"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider using NodeAffinity to align with PV? It also makes it more clear that we use this in the scheduler by comparing with Node topology.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the name AccessibleTopology is best since snapshots aren't node-mounted like PVs, but I changed it to []v1.TopologySelectorTerm (mirroring StorageClass.AllowedTopologies) so the scheduler can use the same label-expression matching against
node topology. Is that okay ? It's kind of a middle ground

Comment thread keps/sig-storage/5943-topology-for-volume-snapshot/README.md Outdated
@mdzraf mdzraf force-pushed the SnapshotTopologyKepInitialPublish branch from 7c0348e to 703c8f0 Compare April 27, 2026 20:10
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: mdzraf
Once this PR has been reviewed and has the lgtm label, please ask for approval from msau42. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.

Projects

Status: Needs Triage
Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

4 participants