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

Make fstype configurable while starting the external-provisioner #328

Closed
Madhu-1 opened this issue Aug 13, 2019 · 30 comments
Closed

Make fstype configurable while starting the external-provisioner #328

Madhu-1 opened this issue Aug 13, 2019 · 30 comments
Assignees
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
Milestone

Comments

@Madhu-1
Copy link
Contributor

Madhu-1 commented Aug 13, 2019

currently in external-provisioner fstype is set to ext4 if nothing is passed in storage-class, we have a requirement to make it configurable so that the SP who is using the external-provisioner can choose the default fstype which they want to have it. This will avoid always mentioning of the fstype in the storage-class.

in rbd csi plugin, we have seen better performance with xfs type, as external-provisioner is defaulting to ext4, in rbd csi we are asking users to mention the fstype as xfs in storage class. if fstype can be configured in external-provisioner user don't need to bother about the default fstype used.

CC @msau42

@Madhu-1
Copy link
Contributor Author

Madhu-1 commented Aug 13, 2019

@humblec FYI

@humblec
Copy link
Contributor

humblec commented Aug 13, 2019

/assign @msau42
/assign @jsafrane

@msau42
Copy link
Collaborator

msau42 commented Aug 13, 2019

I don't think fstype should be defaulted at all. There are filer types like nfs that expect a "" as the fstype

@humblec
Copy link
Contributor

humblec commented Aug 13, 2019

@msau42 As @Madhu-1 mentioned, fstype is set to ext4 in sidecar container if not passed in SC param https://github.com/kubernetes-csi/external-provisioner/blob/master/pkg/controller/controller.go#L437 , so the only way to get around this is via SC parameter which is actually on overhead as all SC has to set this field.

@msau42
Copy link
Collaborator

msau42 commented Aug 13, 2019

That doesn't seem right. Filer types like nfs/gluster/ceph should be failing when they validate fstype

@msau42
Copy link
Collaborator

msau42 commented Aug 13, 2019

See kubernetes/kubernetes#65122

@humblec
Copy link
Contributor

humblec commented Aug 13, 2019

Have to go through in detail, but at glance , CSI pv source has been corrected. This has to be corrected here too. Isnt it ?

@msau42
Copy link
Collaborator

msau42 commented Aug 13, 2019

Yes I don't think external provisioner should default. Now the question is will we break drivers that expect a non empty value? Need to double check CSI spec wording in this

@humblec
Copy link
Contributor

humblec commented Aug 13, 2019

Yes I don't think external provisioner should default. Now the question is will we break drivers that expect a non empty value? Need to double check CSI spec wording in this>

Yeah, we have to cross check on this, and also ( may be ) on backward compatibility of sidecar ?

@msau42
Copy link
Collaborator

msau42 commented Sep 5, 2019

/kind bug

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Sep 5, 2019
@msau42
Copy link
Collaborator

msau42 commented Sep 5, 2019

I spoke with @jsafrane and he suggested we add a --default-fs flag, which defaults to ext4 and then immediately deprecate it. When we have a 2.0, we can remove the defaulting behavior.

Does this sound reasonable to you? Would you have time to work on this?

@jsafrane
Copy link
Contributor

jsafrane commented Sep 5, 2019

Well, we could have --default-fs flag, with "ext4" as default and then change the default to "" after a long enough "deprecation" period - the flag would not be removed, just its default would change.

@msau42
Copy link
Collaborator

msau42 commented Sep 5, 2019

I prefer having the external provisioner not default anything at all and leave it entirely up to the plugin

@humblec
Copy link
Contributor

humblec commented Sep 6, 2019

I spoke with @jsafrane and he suggested we add a --default-fs flag, which defaults to ext4 and then immediately deprecate it. When we have a 2.0, we can remove the defaulting behavior.

Sure.

Does this sound reasonable to you? Would you have time to work on this?

Sure, will work on this. thanks!

@msau42 msau42 added this to To do in K8s 1.17 Oct 5, 2019
@msau42 msau42 removed this from To do in K8s 1.16 Oct 5, 2019
@msau42 msau42 moved this from To do to Backlog in K8s 1.17 Nov 27, 2019
@msau42
Copy link
Collaborator

msau42 commented Dec 4, 2019

@humblec do you still have time to work on this?

@msau42 msau42 added this to Backlog in K8s 1.18 Dec 4, 2019
@msau42
Copy link
Collaborator

msau42 commented Dec 10, 2019

/help

@k8s-ci-robot
Copy link
Contributor

@msau42:
This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed
by commenting with the /remove-help command.

In response to this:

/help

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Dec 10, 2019
@humblec
Copy link
Contributor

humblec commented Dec 10, 2019

@humblec do you still have time to work on this?

@msau42 sure, let me put this in my todo list .

@SandeepPissay
Copy link

I agree with @msau42 that there should be no default FS type in external provisioner at all. The CSI driver can choose the default FS type based on various other factors like access mode and external provisioner should just pass fstype as empty string in create volume request.

humblec added a commit to humblec/external-provisioner that referenced this issue Mar 13, 2020
At present the fstype is set to `ext4` if nothing is passed in storage-class.
However a SP could prefer to have different fstype for many reasons for their
driver/volumes. This patch enables SP who is using the external-provisioner
to choose the default fstype which they want to have it.

Fix# kubernetes-csi#328

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
@jsafrane jsafrane added this to Backlog in K8s 1.19 Apr 9, 2020
@jsafrane jsafrane moved this from Backlog to To do in K8s 1.19 Apr 9, 2020
@msau42 msau42 moved this from Backlog to In progress in K8s 1.19 Apr 10, 2020
@msau42 msau42 removed this from In progress in K8s 1.19 Apr 10, 2020
@fejta-bot
Copy link

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

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 19, 2020
@bswartz
Copy link
Contributor

bswartz commented May 19, 2020

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 19, 2020
humblec added a commit to humblec/external-provisioner that referenced this issue Jun 8, 2020
…class.

However a SP could prefer to have different fstype for many reasons for their
driver/volumes. This patch enables SP who is using the external-provisioner
to choose the fstype which they want to have it.

Fix# kubernetes-csi#328

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
humblec added a commit to humblec/external-provisioner that referenced this issue Jun 11, 2020
…class.

However a SP could prefer to have different fstype for many reasons for their
driver/volumes. This patch enables SP who is using the external-provisioner
to choose the fstype which they want to have it.

Fix# kubernetes-csi#328

Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
@msau42
Copy link
Collaborator

msau42 commented Jun 19, 2020

Fixed in #400
/close

@k8s-ci-robot
Copy link
Contributor

@msau42: Closing this issue.

In response to this:

Fixed in #400
/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@RaunakShah
Copy link
Contributor

@msau42 @humblec I have a question about this bug. Basically what we're saying is that the storage provider should have the capability of choosing their own fsType (based on their own criteria) and Kubernetes will honor that.

I have a bug where no fsType was provided (in the SC or provisioner) and our CSI driver defaulted to ext4. During NodeStageVolume, the volume is formatted - i can view the mount from the k8s node on which this pod was scheduled.

However, Kubernetes' internal state assumes that fsType is empty (presumably because provisioner didn't set anything while making the CreateVolume request). The result is that the securityContext provided in the Pod spec is not honored.

When i add the --default-fsType flag, this gets fixed.

I've provided more details (logs, ref code) here - kubernetes-sigs/vsphere-csi-driver#370 (comment)

Is that the expected behavior? I'm thinking there should be some mechanism for the CSI driver to communicate back to Kubernetes what fsType (if any) was used to format the volume.

@msau42
Copy link
Collaborator

msau42 commented Oct 22, 2020

Good find. That is indeed a problem for plugins that need fsgroup support. For now, I think the best approach is to set the --default-fstype flag. In 1.20, we're targeting promoting the csidriver fsgroup feature to beta, which lets drivers explicitly opt in to supporting fsgroup instead of using this rwo + fstype heuristic.

@humblec
Copy link
Contributor

humblec commented Oct 23, 2020

Agree with both of you :) .. In short if SC and Provisioner does not specify fsType with this version of this sidecar, we have to set the default-fstype flag.

@RaunakShah
Copy link
Contributor

Thanks for the info! I'll keep a look out for the fsgroup feature and make a change to our YAMLs for now

@bswartz
Copy link
Contributor

bswartz commented Oct 23, 2020

None of the solutions work particularly well for meta-CSI plugins like Trident, which support multiple protocols and therefore multiple default FS types. The ideal solution from our perspective would be to allow the SP to tell the CO which fstype it defaulted to when the CO didn't specify one. That requires a CSI spec change though and I don't see it happening soon if ever.

The workaround we're going with is to tell our users to not leave the fstype blank in their storage classes.

@msau42
Copy link
Collaborator

msau42 commented Oct 23, 2020

Yes, I think we should look into adding something to CSI. Windows has a similar issue, in that you may want to default to a different filesystem depending on which node the pod gets scheduled to. @jingxu97 is looking into it

@SandeepPissay
Copy link

We have the same issue that vSphere CSI supports multiple protocols and we default to a protocol based on the create volume request. We definitely need to enhance CSI spec to communicate back the fstype that was used by CSI driver back to CO.

pohly added a commit to pohly/pmem-CSI that referenced this issue Nov 6, 2020
There are cases where it really matters whether the storage class
contains a FS
type (kubernetes-csi/external-provisioner#328 (comment)). To
cover that with our tests we need a storage class that has just the
defaults.

Explicitly setting reclaim policy and immediate binding also only
makes sense to show that those options exists, which is covered by
Kubernetes documentation. We better ensure that we really use the
defaults by not even setting those.
pohly added a commit to pohly/pmem-CSI that referenced this issue Nov 6, 2020
There are cases where it really matters whether the storage class
contains a FS
type (kubernetes-csi/external-provisioner#328 (comment)). To
cover that with our tests we need a storage class that has just the
defaults.

Explicitly setting reclaim policy and immediate binding also only
makes sense to show that those options exists, which is covered by
Kubernetes documentation. We better ensure that we really use the
defaults by not even setting those.
pohly added a commit to pohly/pmem-CSI that referenced this issue Nov 11, 2020
There are cases where it really matters whether the storage class
contains a FS
type (kubernetes-csi/external-provisioner#328 (comment)). To
cover that with our tests we need a storage class that has just the
defaults.

Explicitly setting reclaim policy and immediate binding also only
makes sense to show that those options exists, which is covered by
Kubernetes documentation. We better ensure that we really use the
defaults by not even setting those.

(cherry picked from commit d67a5f3)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/bug Categorizes issue or PR as related to a bug.
Projects
No open projects
K8s 1.18
  
Backlog
Development

No branches or pull requests

9 participants