[kubernetes/kubernetes] Mount code is too difficult to reuse from CSI plugins (#64953)

3 views
Skip to first unread message

Clayton Coleman

unread,
Jun 10, 2018, 11:05:01 PM6/10/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

The mount code (pkg/util/mount) is reasonably well tested but brings in the entire Kubernetes source tree when CSI plugins have to depend on it. With a few exceptions, most of the mount code could be refactored to be a minimal set of utilities that can be layered and make it easier to develop CSI plugins. I noticed that quite a few CSI plugins take a dependency on k/k just to get that one package.

Suggestions:

  1. Refactor and split pkg/util/mount into a minimal dependency library and move it out of k/k (perhaps into staging and have it published out)
  2. Have https://github.com/kubernetes-csi/drivers stop depending on k/k and start depending on that library
  3. Drop dependency on k8s.io/apimachinery/pkg/util/sets so the library is easily usable.

In general, there is a lot of boiler plate for CSI, and pkg/util/mount is a significant portion of reuse.

@kubernetes/sig-storage-bugs


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Jack(Guoliang) Wang

unread,
Jun 11, 2018, 1:35:53 AM6/11/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

If there no one was working on this, I can help do it. :-)

Jack(Guoliang) Wang

unread,
Jun 11, 2018, 1:36:03 AM6/11/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

/assign

Travis Rhoden

unread,
Jul 18, 2018, 12:47:10 PM7/18/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

@wglian is this something you are still looking at? It's come up in sig-storage, and is on the planning spreadsheet for 1.12. It's something I'd like to work on as well, so want to see where you are at with it.

While it didn't get any traction, I will point out that when me and some coworkers wrote several CSI drivers to the 0.1 version of the spec, we saw this problem, and factored this code out into a project that eventually landed at https://github.com/akutz/gofsutil. It looks quite a bit different now, because we found the k/k code didn't handle bind-mounts of block devices correctly, which was something new to CSI and K8s at the time.

Michelle Au

unread,
Jul 18, 2018, 2:38:07 PM7/18/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

@cofyc did some work recently in pkg/util/mount to detect bind mounts better.

What I would like to see is this handled in at least 3 steps:

  1. Refactor Mounter interface to separate out purely mounting helper functions and Kubernetes utilities
  2. Copy the refactored mount library into an external repo, maybe under kubernetes-sigs
  3. Remove mount library from Kubernetes and vendor the external repo

Travis Rhoden

unread,
Jul 18, 2018, 3:13:39 PM7/18/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

@msau42 Awesome. I plan to start working on this now, and i agree with the refactor approach.

I do wonder where the resulting library should end up? Would kubernetes/utils be the right place?, rather than kubernetes/kubernetes-sigs?

k/utils seems odd to me, though, as one goal is to not have to vendor a bunch of code you don't care about. but, k/utils has the intent of holding many different projects in it. So if you want one thing out of it, you have to vendor all of k/utils. I like seeing things in separate repos. =)

Location doesn't hold up the refactoring, however, so I'll work on that!

Michelle Au

unread,
Jul 18, 2018, 3:58:19 PM7/18/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Can it just be a standalone package, like kubernetes/utils/mount?

fejta-bot

unread,
Oct 16, 2018, 4:15:14 PM10/16/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Michelle Au

unread,
Oct 16, 2018, 5:32:33 PM10/16/18
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

/remove-lifecycle stale

fejta-bot

unread,
Jan 14, 2019, 5:26:34 PM1/14/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Michelle Au

unread,
Jan 14, 2019, 7:05:41 PM1/14/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

/remove-lifecycle stale

fejta-bot

unread,
Apr 14, 2019, 9:02:00 PM4/14/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

Travis Rhoden

unread,
Apr 15, 2019, 11:57:05 AM4/15/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

/remove-lifecycle stale

Jordan Liggitt

unread,
Jul 11, 2019, 2:11:17 PM7/11/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

/remove-kind bug
/kind cleanup

Travis Rhoden

unread,
Jul 11, 2019, 3:38:15 PM7/11/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Hi @msau42,

Now that #68513 is merged, I wanted to confirm that the next step here would be to move pkg/util/mount to be a package in k8s.io/utils.

Michelle Au

unread,
Jul 11, 2019, 4:18:44 PM7/11/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Yup!

Davanum Srinivas

unread,
Jul 12, 2019, 9:28:32 AM7/12/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

@codenrhoden let me know if you need a hand with git surgery

Travis Rhoden

unread,
Jul 12, 2019, 2:12:44 PM7/12/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

@dims @msau42 The git-foo wasn't too bad. Just slow to filter on the whole k/k repo. =)

I've opened the PR at kubernetes/utils#100, feel free to take a look.

Once that is in, we'll need to be cognizant to not letting any fixes come into k/k/pkg/util/mount, otherwise they might get lost. Once the package goes into k8s.io/utils, I can open the PR on k/k to make use of it!

fejta-bot

unread,
Oct 10, 2019, 3:11:50 PM10/10/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Travis Rhoden

unread,
Oct 10, 2019, 3:50:19 PM10/10/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

/remove-lifecycle stale


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Kubernetes Prow Robot

unread,
Nov 15, 2019, 1:13:49 PM11/15/19
to kubernetes/kubernetes, k8s-mirror-storage-bugs, Team mention

Closed #64953 via #85305.


You are receiving this because you are on a team that was mentioned.

Reply to this email directly, view it on GitHub, or unsubscribe.

Reply all
Reply to author
Forward
0 new messages