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

Dynamic provisioning for flocker volume plugin #31005

Merged

Conversation

simonswine
Copy link
Contributor

@simonswine simonswine commented Aug 19, 2016

Refactor flocker volume plugin

I based my refactor work to replicate pretty much GCE-PD behaviour

Related issues: #29006 #26908

@jsafrane @mattbates @wallrj @wallnerryan


This change is Reviewable

@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. release-note-label-needed labels Aug 19, 2016
@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from 2b5a589 to ae5699c Compare August 19, 2016 17:17
jessfraz pushed a commit to jessfraz/kubernetes that referenced this pull request Aug 19, 2016
Automatic merge from submit-queue

Adds myself to the flocker volume plugin owners

I am happy to look after the flocker volume plugin and support @agonzalezro. Currently refactoring the volume plugin and adding dynamic provisioning features in kubernetes#31005
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 20, 2016

var _ volume.Provisioner = &flockerVolumeProvisioner{}

func (c *flockerVolumeProvisioner) Provision() (*api.PersistentVolume, error) {
Copy link
Member

Choose a reason for hiding this comment

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

If I am reading it right, you do not support any configuration in StorageClass.Parameters and in PVC.Spec.Selector. In that case, you should check that c.options.parameters and c.options.selector are empty and throw an error if not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok I have added the tests and checks accordingly, with the latest changes

@jsafrane
Copy link
Member

I reviewed the provisioner and it looks pretty solid at this point.

@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from ae5699c to e32c910 Compare August 24, 2016 07:52
@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Aug 24, 2016
@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from e32c910 to fbdbb1b Compare August 25, 2016 08:32
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 25, 2016
@simonswine
Copy link
Contributor Author

@jsafrane Thanks for the review. I've just modified it based on your comments. I think there's no point to hurry, as it won't be merged into 1.4 anyhow?

@k8s-bot
Copy link

k8s-bot commented Aug 25, 2016

GCE e2e build/test passed for commit fbdbb1b.

@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Aug 25, 2016
@k8s-bot
Copy link

k8s-bot commented Aug 29, 2016

Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test".
(Note: "add to whitelist" is no longer supported. Please update configurations in kubernetes/test-infra/jenkins/job-configs/kubernetes-jenkins-pull instead.)

This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry.

@jsafrane jsafrane added sig/storage Categorizes an issue or PR as relevant to SIG Storage. team/cluster release-note-none Denotes a PR that doesn't merit a release note. and removed release-note-label-needed labels Sep 20, 2016
@jsafrane
Copy link
Member

it won't be merged into 1.4 anyhow

No, this is for 1.5. I went through current versions, just a few documentation nits found. Please rebase and finish the deleter!


Reviewed 3 of 22 files at r1, 3 of 20 files at r2, 19 of 19 files at r3, 9 of 9 files at r4.
Review status: all files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


pkg/api/types.go, line 746 [r4] (raw file):

// Flocker volumes do not support ownership management or SELinux relabeling.
type FlockerVolumeSource struct {
  // One and only one of the following should be specified.

IMO, this line should be in FlockerVolumeSource docs, i.e. two lines up ("only one of DatasetName and DatasetUUID should be set"). Otherwise it's godoc of DatasetName, which is quite confusing.


pkg/api/v1/types.go, line 651 [r4] (raw file):

// Flocker volumes do not support ownership management or SELinux relabeling.
type FlockerVolumeSource struct {
  // One and only one of the following should be specified.

dtto, this is godoc of DatasetName, which does not make sense.


Comments from Reviewable

@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from fbdbb1b to 276a21d Compare September 22, 2016 09:17
@simonswine
Copy link
Contributor Author

Review status: 0 of 38 files reviewed at latest revision, 4 unresolved discussions, some commit checks failed.


pkg/api/types.go, line 746 [r4] (raw file):

Previously, jsafrane (Jan Šafránek) wrote…

IMO, this line should be in FlockerVolumeSource docs, i.e. two lines up ("only one of DatasetName and DatasetUUID should be set"). Otherwise it's godoc of DatasetName, which is quite confusing.

Done.

pkg/api/v1/types.go, line 651 [r4] (raw file):

Previously, jsafrane (Jan Šafránek) wrote…

dtto, this is godoc of DatasetName, which does not make sense.

Done.

Comments from Reviewable

@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from 276a21d to bd245f7 Compare September 22, 2016 09:22
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 22, 2016
@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from 47acefe to 77bf500 Compare September 24, 2016 08:34
@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 24, 2016
@simonswine
Copy link
Contributor Author

@k8s-bot gci gce e2e test this
@k8s-bot gke e2e test this

@k8s-ci-robot
Copy link
Contributor

Jenkins GCI GCE e2e failed for commit 77bf500. Full PR test history.

The magic incantation to run this job again is @k8s-bot gci gce e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@simonswine
Copy link
Contributor Author

@k8s-bot gci gce e2e test this
@k8s-bot gke e2e test this

@simonswine
Copy link
Contributor Author

@jsafrane if you have the chance, could you do another review please? From my point of view it's ready to merge.,

Do you think an exampe is necessary (like the ones in https://github.com/kubernetes/kubernetes/tree/master/examples/experimental/persistent-volume-provisioning)?

@jsafrane
Copy link
Member

Reviewed 1 of 24 files at r1, 1 of 20 files at r2, 6 of 42 files at r5, 14 of 34 files at r8, 13 of 13 files at r9, 9 of 9 files at r10.
Review status: all files reviewed at latest revision, all discussions resolved.


Comments from Reviewable

@jsafrane
Copy link
Member

almost LGTM, only all log messages should start with lowercase. Simple grep for glog will reveal them all. I should have noticed it earlier.

@jsafrane jsafrane assigned jsafrane and unassigned thockin Sep 27, 2016
@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from 77bf500 to 0f92148 Compare September 27, 2016 13:09
@k8s-github-robot k8s-github-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 27, 2016
* flocker datasets should be attached using an unique identifier. This
  is not the case for the name metadata used by datasetName
* allow only one of datasetUUID / datasetName specified
Supports additional options for CreateDataset and DeleteDataset for dynamic provisioning. Bugfix for timeouts during CreateDataset
* Support provisioning
* Support deletion
* Use bind mounts instead of /flocker in containers
* support ownership management or SELinux relabeling.
@simonswine simonswine force-pushed the feature-flocker-dyn-provisioning branch from 0f92148 to cd08978 Compare September 27, 2016 13:20
@simonswine
Copy link
Contributor Author

@jsafrane Ok I have downcased all the log messages

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 27, 2016
@jsafrane
Copy link
Member

Reviewed 1 of 24 files at r1, 1 of 20 files at r2, 6 of 42 files at r5, 5 of 13 files at r9, 1 of 23 files at r11, 13 of 13 files at r12, 9 of 9 files at r13.
Review status: all files reviewed at latest revision, 2 unresolved discussions.


Comments from Reviewable

@jsafrane
Copy link
Member

LGTM. Thanks a lot for the PR!

@jsafrane jsafrane added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 27, 2016
@simonswine
Copy link
Contributor Author

simonswine commented Sep 27, 2016

@jsafrane I think the only thing missing now is the reviewable "discussions"

Thanks for reviewing!

@jsafrane
Copy link
Member

reviewable discussions are optional, important is that "Submit Queue" is green - it's in the queue and it will be merged eventually.

@simonswine
Copy link
Contributor Author

@jsafrane 👍 thanks for clarifying, not too familiar with reviewable yet

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-ci-robot
Copy link
Contributor

Jenkins GKE smoke e2e failed for commit cd08978. Full PR test history.

The magic incantation to run this job again is @k8s-bot gke e2e test this. Please help us cut down flakes by linking to an open flake issue when you hit one in your PR.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@eddytruyen
Copy link

eddytruyen commented Jan 21, 2017

I get an error from kubelet when mounting flocker volumes using hyperkube:1.5.1
When using hyperkube:1.4.8 everything workes fine.
I do not use dynamic volume provisioning (I.e.I created flocker volume first using flockerctl)

Kube Setup:
Ubuntu trusty nodes
I am using my own extension to docker-multinode that integrates with flocker: https://github.com/eddytruyen/kube-deploy/tree/master/docker-multinode

Flocker Setup: 1.15
Datasetprovider: Cinder (openstack)

Error log when deploying mysql: https://github.com/kubernetes/kubernetes/tree/master/examples/mysql-wordpress-pd. (I changed the volume YAML file such that a localhost volume is changed into a flocker dataset):

  11m           1m              13      {kubelet k8-worker-1}                 
Warning          FailedMount     MountVolume.SetUp failed for volume "kubernetes.io/flocker/38b02b01-dfb5-11e6-83a8-fa163ef52647-local-pv-1" (spec.Name: "local-pv-1") pod "38b02b01-dfb5-11e6-83a8-fa163ef52647" (UID: "38b02b01-dfb5-11e6-83a8-fa163ef52647") with: mount failed: exit status 32
Mounting command: mount
Mounting arguments: /flocker/286d6e19-e715-49e8-9eab-489b325a7d9c /var/lib/kubelet pods/38b02b01-dfb5-11e6-83a8-fa163ef52647/volumes/kubernetes.io~flocker/local-pv-1  [bind]
Output: mount: special device /flocker/286d6e19-e715-49e8-9eab-489b325a7d9c does not exist

@WitoDelnat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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-none Denotes a PR that doesn't merit a release note. sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants