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

Add FSType for CSI volume source #58209

Merged
merged 2 commits into from Jan 18, 2018

Conversation

NickrenREN
Copy link
Contributor

What this PR does / why we need it:
Add FSType for CSI volume source to specify filesystems (alpha defaults to ext4)

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #58183

Special notes for your reviewer:

Release note:

Add FSType for CSI volume source to specify filesystems

/assign @saad-ali
cc @vladimirvivien

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 12, 2018
@k8s-github-robot k8s-github-robot added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Jan 12, 2018
@liggitt
Copy link
Member

liggitt commented Jan 14, 2018

cc @kubernetes/sig-storage-api-reviews

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label Jan 14, 2018
@jsafrane
Copy link
Member

/approve
from storage point of view

@@ -197,7 +197,7 @@ func (c *csiMountMgr) SetUpAt(dir string, fsGroup *int64) error {
accessMode,
c.volumeInfo,
attribs,
"ext4", //TODO needs to be sourced from PV or somewhere else
csiSource.FSType,
Copy link
Member

Choose a reason for hiding this comment

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

Comment above says that Implicitly inferred to be "ext4" if unspecified. We need some code for that if csiSource.FSType is empty.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I saw that in drivers repo, we would defaults FSType to ext4 in function formatAndMount if it was not set. Should we deal with this here ?
btw, when this gets merged, i will update the external provisioner to add FSType for newly created PV if it is set in StorageClass parameters.

Copy link
Member

Choose a reason for hiding this comment

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

We don't have control about all CSI drivers in the wold to fall back to ext4 when nothing is specified. Other drivers may choose a different default, so it's Kubernetes who should enforce ext4 here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done, thanks, PTAL

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 16, 2018
@NickrenREN
Copy link
Contributor Author

/assign @jsafrane

@jsafrane
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 16, 2018
@NickrenREN
Copy link
Contributor Author

/assign @thockin

@vladimirvivien
Copy link
Member

@NickrenREN last time I had to manually make type changes in staging/src/k8s.io/api/core/v1/types.go . You will need to make FSType change there as well.

@NickrenREN
Copy link
Contributor Author

@vladimirvivien i have already changed that in my first commit

@saad-ali
Copy link
Member

/lgtm
/approve

One more thing to consider for API review:

Does this aligns with how we plan to expose block storage long term? Having the fstype inside the volume source, if I remember correctly was an API choice that we somewhat regretted when trying to introduce block volume support. That said, all the in-tree volumes currently have fstype as part of the volume source, so this aligns with that.

@mtanino, @erinboyd any comments??

@msau42
Copy link
Member

msau42 commented Jan 16, 2018

During the block design, the idea came up that it could be cleaner if fstype was in the PVC instead of per volume type, so that we could standardize fs handling across all volume types instead of having each plugin handle it.

@mtanino
Copy link

mtanino commented Jan 17, 2018

@saad-ali @msau42

IIUC,

During the block design, the idea came up that it could be cleaner if fstype was in the PVC instead of per volume type, so that we could standardize fs handling across all volume types instead of having each plugin handle it.

Do you mean volume source rather than volume type?
I believe each volume source or persistent volume source should have fstype since this parameter is characteristic of volume.
But adding fstype into PVC then just pass through the value to PV would be interesting.
because;

  • volumeMode and fstype are strongly related parameter
  • we can easily validate volumeMode and fstype if both of them are in the same PVC object

However, I believe changing this affects big(?) impact to all plugins, also we need keep backward compatibility, therefore I think we don't have a plan to change this.

@erinboyd @screeley44
Any comments?

@msau42
Copy link
Member

msau42 commented Jan 17, 2018

Yeah I meant putting the fsType in the higher level PV/PVC, instead of as a parameter in each volume-specific source. Then fs formatting and supporting scenarios like fs-on-block could be done by Kubernetes instead of every single plugin.

But yes, this is a major change and would be messy when also considering backwards compatibility, so we just stayed with the current way of specifying fsType in every volume source spec.

@mtanino
Copy link

mtanino commented Jan 17, 2018

@saad-ali
Thus I agree this API change.

@NickrenREN
Copy link
Contributor Author

NickrenREN commented Jan 17, 2018

thanks @mtanino , ping @saad-ali @msau42 @thockin for approval

@saad-ali
Copy link
Member

Sounds good to me. Will need to clean this up for Kubernetes 2.0!

@thockin for API approval

@thockin
Copy link
Member

thockin commented Jan 18, 2018

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, NickrenREN, saad-ali, thockin

Associated issue: #58183

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

Needs approval from an approver in each of these OWNERS Files:

You can indicate your approval by writing /approve in a comment
You can cancel your approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 18, 2018
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@k8s-github-robot
Copy link

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/storage Categorizes an issue or PR as relevant to SIG Storage. 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.

CSI - fsType is not being passed to driver
10 participants