kubernetes-retired / external-storage

[EOL] External storage plugins, provisioners, and helper libraries
Apache License 2.0
2.69k stars 1.6k forks source link

Prototype for nfs-client alias mode #1318

Closed therc closed 4 years ago

therc commented 4 years ago

This might be a solution for #1210 and #1275

In combination with an existing NFS claim in namespace X, allow the administrator or the users to create new claims for the same NFS tree in namespaces A, B, C, etc.

This change tries as much as possible NOT to disrupt existing setups.

A few things still left:

  1. Is "alias" the right term? Previous choices I tossed out: clone (easy to mix with real volume cloning), proxy (there's no middle-man NFS server), passthrough (too nebulous).
  2. Is NFS_SERVER=--alias the best way to trigger this?
  3. Should the auto-detection of the server host:path happen always, even when not in alias mode?
  4. Should the parent's ReadOnly field be propagated to the newly provisioned PV?
  5. Should this be made more generic so that one deployment can expose N different claims/trees to the other namespaces? See comment below for more details.
k8s-ci-robot commented 4 years ago

Welcome @therc!

It looks like this is your first PR to kubernetes-incubator/external-storage 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-incubator/external-storage has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 4 years ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: To complete the pull request process, please assign wongma7 You can assign the PR to them by writing /assign @wongma7 in a comment when ready.

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

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/kubernetes-incubator/external-storage/blob/master/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
therc commented 4 years ago

"Clone mode" is very confusing, I think "passthrough" is clearer and more descriptive. "Alias" mode might be the clearest choice.

Naming aside, this could be made more generic so that you don't need to run a million alias provisioners if you have more than one NFS tree to expose to your namespaces.

Let's say you have three existing claims: data, code, docs. You want them to be available in any number of other namespaces, as allowed by RBAC. You run the nfs-client provisioner foo.com/nfs-alias, mounting the three claims under /persistentvolumes/. Add a storage class shared-volumes using the new provisioner. Now I create claim code in namespace developer1 under that class. The provisioner will lookup the server:path for /persistentvolumes/code and stick those in a new volume developer1-code-BLABLABLA.

If others agree that the generic, multi-claim approach is better, I can change alias mode to use NFS_PATH as the directory inside the provisioner's container where we look up mounted claims. In the example above, it would be set to /persistentvolumes.

therc commented 4 years ago

Ping?

kmova commented 4 years ago

@therc - We are in the middle of migrating the NFS client code into a new home under https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner. The migration PR is up for review at the moment. https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/2

Sorry to have kept mum on this PR for a while, can I circle back with you once the above migration PR is merged and take your help to shift these changes into the new repo?

therc commented 4 years ago

Sounds good, @kmova... thank you!

nikhita commented 4 years ago

As @kmova mentioned, we are in the process of archiving this repo and continuing work in https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner. Please reopen a PR in the new repo once https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner/pull/2 has merged. Thanks for your patience! :)

Going to close this PR in order to be able to archive this repo.