Skip to content
This repository has been archived by the owner on Oct 21, 2020. It is now read-only.

mountOptions support for local storage #1005

Merged
merged 1 commit into from
Oct 5, 2018

Conversation

lichuqiang
Copy link
Contributor

Address kubernetes/kubernetes#68317
Follow-up kubernetes/kubernetes#69211
let the plugin pass the mountOptions specified in storageclasses into the PVs to make it effective

/area local-volume
/kind feature

/assign @msau42

@k8s-ci-robot k8s-ci-robot added area/local-volume kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 28, 2018
@@ -255,12 +274,16 @@ func (d *Discoverer) discoverVolumesAtPath(class string, config common.MountConf
glog.Errorf("Path %q fs stats error: %v", filePath, err)
continue
}
if len(mountOptions) != 0 {
glog.Warningf("Path %q is already in filesystem mode, "+
Copy link
Contributor

Choose a reason for hiding this comment

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

When we do the bind mount for filesystem mode, could you actually specify different mount options?

Copy link

Choose a reason for hiding this comment

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

hmm, you can actually.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, thanks for pointing this out. I was mainly focus on the change this time, and did not think so thoroughly.

Then I wonder why we don't support mount options before, since we can also have the requirement in the bind mount scenario.

Copy link
Contributor Author

@lichuqiang lichuqiang Sep 29, 2018

Choose a reason for hiding this comment

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

Hmm, I think it's because the mount options here is kind of different from that of others.
It is not used in MountDevice or Provision phase.

Then I think it worth considering if users do have practical requirement for this, though it's supported to specify mount options in bind mount theoretically.
I see other kinds of storages did not take mount options into account in SetUp

But on the other hand, things can be different to local volume: for other storages, the options have take effect in other phase (MountDevice) of volume lifecycle, so can be ignored during SetUp, but this is not true for local volume, so perhaps we'll still need it.

Copy link
Contributor

Choose a reason for hiding this comment

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

This PR updated all the volume plugins to take the same mount options for both MountDevice and SetUp: kubernetes/kubernetes#68945

Copy link

Choose a reason for hiding this comment

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

The fact that all volume plugins do not pass mount options when calling bind was an oversight - kubernetes/kubernetes#68945 which we fixed.

I know it is tricky for local volumes. We know that, file system mount options are ignored by bind mount and only userspace mount options do get applied. local volumes may not need too many userspace mount options so we might be safe.

@msau42
Copy link
Contributor

msau42 commented Oct 4, 2018

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Oct 4, 2018
@wongma7 wongma7 merged commit 5742e69 into kubernetes-retired:master Oct 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/local-volume cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants