Skip to content

feat: pin volume and workload pod to the original topology#4478

Open
bachmanity1 wants to merge 2 commits intolonghorn:masterfrom
bachmanity1:feat/12517
Open

feat: pin volume and workload pod to the original topology#4478
bachmanity1 wants to merge 2 commits intolonghorn:masterfrom
bachmanity1:feat/12517

Conversation

@bachmanity1
Copy link
Contributor

Which issue(s) this PR fixes:

Issue longhorn/longhorn#12517

What this PR does / why we need it:

Special notes for your reviewer:

Additional documentation or context

@coderabbitai
Copy link

coderabbitai bot commented Jan 21, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • 🔍 Trigger a full review
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

🧪 Unit Test Generation v2 is now available!

We have significantly improved our unit test generation capabilities.

To enable: Add this to your .coderabbit.yaml configuration:

reviews:
  finishing_touches:
    unit_tests:
      enabled: true

Try it out by using the @coderabbitai generate unit tests command on your code files or under ✨ Finishing Touches on the walkthrough!

Have feedback? Share your thoughts on our Discord thread!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@bachmanity1 bachmanity1 requested a review from derekbit January 22, 2026 01:49
@bachmanity1 bachmanity1 force-pushed the feat/12517 branch 2 times, most recently from 7d80d4d to fca1cf9 Compare January 22, 2026 06:19
@bachmanity1
Copy link
Contributor Author

bachmanity1 commented Jan 27, 2026

I realized this can also be done using the Kubernetes VolumeZone scheduler plugin together with topology labels on the PV.

In this case, we would just need to add the zone label to the PV in the volume controller. Maybe we can add a new volume spec field to control this behavior. The labeling could be handled in ReconcilePersistentVolume function in the volume controller.

One advantage of this approach is that it works for both delayed and immediate binding modes. But even though the VolumeZone plugin is enabled by default, it’s a pretty old plugin and seems to be kept mostly for backward compatibility. From what I see, the recommended approach now is to use PV node affinity instead.

Signed-off-by: bachmanity1 <bachmanity138@gmail.com>
Signed-off-by: bachmanity1 <bachmanity138@gmail.com>
@bachmanity1
Copy link
Contributor Author

I've updated the implementation based on my comment above. This feature now relies on the VolumeZone scheduler plugin. I think the current version is less complicated and more k8s-native. The previous version is here. If you prefer that one, please let me know.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments