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

Support "fstype" parameter in dynamically provisioned PVs #45345

Merged
merged 1 commit into from
Jul 24, 2017

Conversation

codablock
Copy link
Contributor

This PR is a replacement for #40805. I was not able to push fixes and rebases to the original branch as I don't have access to the Github organization anymore.

I assume the PR will need a new "ok to test"

ORIGINAL PR DESCRIPTION

What this PR does / why we need it: This PR allows specifying the desired FSType when dynamically provisioning volumes with storage classes. The FSType can now be set as a parameter:

kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: test
provisioner: kubernetes.io/azure-disk
parameters:
  fstype: xfs

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #37801

Special notes for your reviewer:
The PR also implicitly adds checks for unsupported parameters.

Release note:

Support specifying of FSType in StorageClass

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label May 4, 2017
@k8s-reviewable
Copy link

This change is Reviewable

@k8s-ci-robot
Copy link
Contributor

Hi @codablock. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with @k8s-bot ok to test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

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. I understand the commands that are listed here.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 4, 2017
@k8s-github-robot k8s-github-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 4, 2017
@spiffxp
Copy link
Member

spiffxp commented May 8, 2017

@k8s-bot ok to test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label May 8, 2017
Copy link
Member

@jsafrane jsafrane left a comment

Choose a reason for hiding this comment

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

@@ -107,6 +107,7 @@ var _ volume.Provisioner = &azureDiskProvisioner{}

func (a *azureDiskProvisioner) Provision() (*v1.PersistentVolume, error) {
var sku, location, account string
var FSType *string
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it be "ext4" by default so it's consistent among all volume plugins?

Copy link
Contributor Author

@codablock codablock May 9, 2017

Choose a reason for hiding this comment

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

If I remember correct, Azure already does the default fstype handling later and I did not want to touch that part. Azure was well tested by me at that time and it worked well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just pushed an update to the examples.

@jsafrane
Copy link
Member

jsafrane commented May 9, 2017

@k8s-bot gce etcd3 e2e test this
@k8s-bot kops aws e2e test this

@codablock codablock force-pushed the storageclass_fstype branch from 5faf0d5 to 2b1a373 Compare May 9, 2017 12:08
```

* `type`: `io1`, `gp2`, `sc1`, `st1`. See AWS docs for details. Default: `gp2`.
* `zone`: AWS zone. If not specified, a random zone from those where Kubernetes cluster has a node is chosen.
* `iopsPerGB`: only for `io1` volumes. I/O operations per second per GiB. AWS volume plugin multiplies this with size of requested volume to compute IOPS of the volume and caps it at 20 000 IOPS (maximum supported by AWS, see AWS docs).
* `encrypted`: denotes whether the EBS volume should be encrypted or not. Valid values are `true` or `false`.
* `kmsKeyId`: optional. The full Amazon Resource Name of the key to use when encrypting the volume. If none is supplied but `encrypted` is true, a key is generated by AWS. See AWS docs for valid ARN value.
* `fstype`: fstype that are supported by kubernetes. Default: `"ext4"`.
Copy link
Member

Choose a reason for hiding this comment

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

fstype -> fsType?

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 copied this line 1:1 from vSphere where fstype was already supported. If I change it to fsType, I'll change it there as well. What do you think?

Copy link
Member

Choose a reason for hiding this comment

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

It's a typo, please change it to fsType. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changed.

@humblec
Copy link
Contributor

humblec commented May 11, 2017

@codeblock LGTM. Please rebase.

@codablock codablock force-pushed the storageclass_fstype branch from 2b1a373 to fa98965 Compare May 11, 2017 07:51
@tpetr
Copy link
Contributor

tpetr commented May 17, 2017

Anything I can do to help move this along?

@codablock codablock force-pushed the storageclass_fstype branch from fa98965 to f8886ce Compare May 18, 2017 09:07
@codablock
Copy link
Contributor Author

@k8s-bot gce etcd3 e2e test this

@bbeaudreault
Copy link

I'm blocked by this as well

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 23, 2017
@codablock codablock force-pushed the storageclass_fstype branch from f8886ce to 7a23bcc Compare May 24, 2017 07:51
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 24, 2017
@codablock
Copy link
Contributor Author

Can anyone help with the test failures please? They look completely unrelated but keep failing all the time and I really don't know what to look for.

@wongma7
Copy link
Contributor

wongma7 commented May 26, 2017

Some statefulset tests rely on dynamic provisioning, they are definitely related.

Dug through controller manager logs for you:

I0524 08:25:06.367294 5 pv_controller.go:1336] failed to provision volume for claim "e2e-tests-statefulset-71bln/datadir-ss-0" with StorageClass "standard": invalid option "type" for volume plugin kubernetes.io/gce-pd

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 26, 2017
case volume.VolumeParameterFSType:
FSType = v
default:
return nil, fmt.Errorf("invalid option %q for volume plugin %s", k, c.plugin.GetPluginName())
Copy link
Contributor

Choose a reason for hiding this comment

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

There is existing parameters (type, zone) parsing in gce_util.go; this is why the tests are failing

Copy link
Contributor

Choose a reason for hiding this comment

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

same for aws, cinder, photon, and vsphere, they all have _util.go files where the new parameter should be added

@saad-ali
Copy link
Member

CC @kubernetes/sig-storage-pr-reviews @gnufied @thockin @wattsteve @childsb

Erin, brought this PR up as related to our discussion about FSs this morning. FWIW, this aligns with the direction I was thinking. FSType is codified as a parameter in the provisioner. Once @jsafrane's "user selectable storage class options" is complete, cluster admins would also be able to filter FS types, it if they want, along with other StorageClass parameters. As implemented it sets the FSType in on the PV object which is then used during mounting--the nice thing about that is it works seamlessly with pre-provisioned volumes.

@k8s-ci-robot k8s-ci-robot added the sig/storage Categorizes an issue or PR as relevant to SIG Storage. label May 26, 2017
@kangarlou
Copy link
Contributor

kangarlou commented Jul 5, 2017

I agree with the sentiment that parameters in the storage class should always be treated as opaque. As a result, we shouldn't promote any keywords in the parameters section of the storage class. I also think fsType shouldn't be a keyword outside of the parameters section as for the most part it's limited to iSCSI/SAN volumes and that there are countless other knobs that other plugins require. Where do we draw the line? Should mount options be added as new keywords in the storage class?

I'm of the opinion that it's perfectly ok for a volume plugin to make use of fsType or other knobs as opaque parameters in the storage class. Based on the type of the parameter and security/operational concerns, volume plugins may or may not allow overwriting the admin-defined value in the storage class by having users make use of PVC annotations. Here is an example of how to use PVC annotations to specify file system type: https://github.com/NetApp/trident#kubernetes-volumes. As you see, it's not even necessary to have a field in the storage class for fsType when it's of no concern to the admin. Obviously, in the future we should use labels to specify volume creation parameters, but till then, PVC annotations are a much better interim solution than redefining existing API objects.

@codablock
Copy link
Contributor Author

Any chance to get a final approval here? The merge robot suggests @smarterclayton for approval.

As more time passes, as harder it gets for me to participate in discussions as I'm not actively working on k8s anymore. I'll do a final rebase when final approval is done if that's ok with everyone, as this PR already required quite a lot of rebases in the past as code seems to move fast in the touched places.

@jsafrane
Copy link
Member

Unfortunately, examples/OWNERS has very little approvers. I scheduled an item on the next sig-storage meeting to formally approve these API changes next Thursday, after that it could be merged, the code is solid.

@codablock codablock force-pushed the storageclass_fstype branch from f94c9b8 to 8057056 Compare July 19, 2017 11:33
@k8s-github-robot k8s-github-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jul 19, 2017
@codablock
Copy link
Contributor Author

Did another rebase to prepare for the formal approval. Also, I had to create another PR in kubernetes/examples: kubernetes/examples#28 as the README.md for the examples has moved to this repo.

@codablock
Copy link
Contributor Author

/retest

@codablock
Copy link
Contributor Author

@k8s-bot kops aws e2e test this
@k8s-bot gce etcd3 e2e test this

@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 Jul 21, 2017
@k8s-github-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: codablock, jsafrane

Associated issue: 37801

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

@jsafrane
Copy link
Member

Thanks for the PR and your patience!

@jsafrane
Copy link
Member

/retest

1 similar comment
@jsafrane
Copy link
Member

/retest

@jsafrane
Copy link
Member

come on...
/retest

@codablock
Copy link
Contributor Author

Are these failures unrelated flakes? Or should I take a deeper look?

@jsafrane
Copy link
Member

they're flakes

@jsafrane
Copy link
Member

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 24, 2017

@codablock: The following tests failed, say /retest to rerun them all:

Test name Commit Details Rerun command
Jenkins kops AWS e2e f8886ced4a93509a92cbb182283eb48eccb513fe link @k8s-bot kops aws e2e test this
Jenkins GCE etcd3 e2e f8886ced4a93509a92cbb182283eb48eccb513fe link @k8s-bot gce etcd3 e2e test this

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

@jsafrane
Copy link
Member

/retest

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 45345, 49470, 49407, 49448, 49486)

@k8s-github-robot k8s-github-robot merged commit d286f56 into kubernetes:master Jul 24, 2017
@tpetr
Copy link
Contributor

tpetr commented Jul 24, 2017

@codablock @jsafrane Woohoo! Thank you for your persistence here.

dims pushed a commit to dims/kubernetes that referenced this pull request Feb 8, 2018
Automatic merge from submit-queue (batch tested with PRs 45345, 49470, 49407, 49448, 49486)

Support "fstype" parameter in dynamically provisioned PVs

This PR is a replacement for kubernetes#40805. I was not able to push fixes and rebases to the original branch as I don't have access to the Github organization anymore.

I assume the PR will need a new "ok to test" 

**ORIGINAL PR DESCRIPTION**

**What this PR does / why we need it**: This PR allows specifying the desired FSType when dynamically provisioning volumes with storage classes. The FSType can now be set as a parameter:
```yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: test
provisioner: kubernetes.io/azure-disk
parameters:
  fstype: xfs
```

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes kubernetes#37801

**Special notes for your reviewer**:
The PR also implicitly adds checks for unsupported parameters.

**Release note**:

```release-note
Support specifying of FSType in StorageClass
```
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. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow to set FSType for dynamically provisioned volumes