Skip to content
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

fix: detangle code and unmount old vols on start #43

Merged
merged 9 commits into from
Feb 6, 2025

Conversation

olevski
Copy link
Member

@olevski olevski commented Feb 5, 2025

A few things change here:

  • I added a function that will unmount volumes from the code rather than doing it with a shell script from a lifecycle hook in k8s
  • CSI drivers have 2 components - a node service and a controller service. The node service has to run on every node and in our case has to run rclone. The controller service is much simpler and there should be only 1. Also only the node service can unmount the volumes at startup. Before this change, rclone ran on the controller and the node service. But now it only runs where it is needed.
  • We build a single executable that can run both components. This is good. But I added a cmd line args to make it so that only the needed stuff runs on the node or controller services. Not everything in all cases.
  • Weird things were pinned in the go.mod file. I suspect this had to do with the nix setup. It took me several hours to figure out why my packages were not updating.

I tested manually in a kind cluster that I can restart the node service while there are actively mounted volumes. And the volumes were correctly unmounted and the node service started back up.

@olevski olevski requested a review from a team as a code owner February 5, 2025 17:41
@olevski olevski force-pushed the fix-unmount-old-vols-on-start branch from 3b96954 to b9e963c Compare February 5, 2025 18:48
Copy link
Member

@Panaetius Panaetius left a comment

Choose a reason for hiding this comment

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

Nice changes! Just two minor changes, not really related to the logic itself.

@olevski olevski requested a review from Panaetius February 6, 2025 09:30
@olevski olevski merged commit 6b10dc1 into master Feb 6, 2025
1 check passed
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