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

Expose shouldProvision to provisioners via new controller interface #588

Merged
merged 1 commit into from
Feb 12, 2018
Merged

Expose shouldProvision to provisioners via new controller interface #588

merged 1 commit into from
Feb 12, 2018

Conversation

aka-bo
Copy link
Contributor

@aka-bo aka-bo commented Feb 2, 2018

Added new controller.Qualifier interface which is implemented by
any controller that has a ShouldProvision method. When implemented,
the provisioner's ShouldProvision method is called by lib controller's
shouldProvision with a return value of false from the former
resulting in the same from the latter.

This allows provisioners the opportunity to ignore individual claims
prior to attaining leadership for the claim, avoiding uneccessary
election cycles when multiple provisioners are serving the same storage
class.

Added new `controller.Qualifier` interface which is implemented by
any controller that has a `ShouldProvision` method. When implemented,
the provisioner's `ShouldProvision` method is called by lib controller's
`shouldProvision`, with a return value of false from the former
resulting in the same from the latter.

This allows provisioners the opportunity to ignore individual claims
prior to attaining leadership for the claim, avoiding uneccessary
election cycles when multiple provisioners are serving the same storage
class.
@k8s-ci-robot k8s-ci-robot added 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 Feb 2, 2018
@rootfs
Copy link
Contributor

rootfs commented Feb 7, 2018

/assign @jsafrane

@jsafrane
Copy link
Contributor

jsafrane commented Feb 9, 2018

This allows provisioners the opportunity to ignore individual claims prior to attaining leadership for the claim

Do you have a use case where this is useful? So far all instances of one provisioner were equal and each of them could provision all PVCs.

@aka-bo
Copy link
Contributor Author

aka-bo commented Feb 9, 2018

So far the most applicable use cases we've encountered are centered around capacity. While all instances of a provisioner start out on equal footing, over time each instance has the potential to exhaust the capacity of its backing storage medium at different rates, e.g., available disk space or--in the case of NFS--max exports. When this happens today an instance will still attempt to gain leadership for a PVC even when it lacks the ability to provision, leading to significant delays in provisioning.

@jsafrane
Copy link
Contributor

Ok, that sound useful.
/lgtm

@childsb, please merge.

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 12, 2018
@childsb childsb merged commit 5ec20e0 into kubernetes-retired:master Feb 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. 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