Adding Webhook To Handle Snapshot Topology During Scheduling #1497
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.46) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 457 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.367
Shallow Review Depth
shallow_review_depth
0.344
Real PR Conversation Timeline
1 comments
"Review active on #1497"
general
weight: 0.35
xing-yang
What type of PR is this?
/kind feature
What this PR does / why we need it:
KEP-5943 records where a snapshot can be restored in
VolumeSnapshotContent.spec.nodeAffinity. For Immediate binding, https://github.com/kubernetes-csi/external-provisioner/pull/1552 restricts provisioning to that topology. ForWaitForFirstConsumer, the scheduler picks the node before the volume is provisioned, so nothing stops it from choosing a node where the snapshot can't be restored.This PR adds
snapshot-topology-webhook, an opt-in component behind theVolumeSnapshotTopologyfeature gate:volume.kubernetes.io/selected-nodeupdate to a node that the content'snodeAffinitydoesn't allow.Other Options Discarded
- VolumeSnapshot and VolumeSnapshotContent are CRDs owned by external-snapshotter, so in-tree scheduler code can't depend on them.
- This was our initial approach (PR). SIG Scheduling suggested moving the functionality to a SIG Storage-owned repo because they don't have the bandwidth to guarantee its maintenance, and at the Sept 17, 2026 SIG Storage meeting it was agreed this repo is the right place.
- The webhook works with the default scheduler, so users don't need to deploy a second scheduler or replace the default one, and workloads don't need to set schedulerName.
Special notes for your reviewer:
Intentionally left the test files out so that reviewers can focus on the actual code first and not have an even larger diff. Hence the hold on the PR.
Manual Testing
Tested manually on a 3-zone kops cluster (Kubernetes 1.36) with the EBS CSI driver, the CRDs, snapshot-controller and csi-snapshotter sidecar built from this branch, cert-manager, and
snapshot-topology-webhook(2 replicas,VolumeSnapshotTopology=true):nodeAffinity, both dynamically created and pre-provisioned. Pods landed only on allowed nodes.--gate-timeout.nodeName, readiness and the SIGTERM drain during a rollout, serving-cert renewal without a restart,--vlevels, and the documented uninstall.Does this PR introduce a user-facing change?:
<!--
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
``
release-note
``Added snapshot-topology-webhook, which keeps pods with WaitForFirstConsumer PVCs restored from a VolumeSnapshot on nodes allowed by the VolumeSnapshotContent's nodeAffinity.