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

Handle `matchFields` `nodeSelectorTerm`s in PVs #81784

Open
wants to merge 1 commit into
base: master
from

Conversation

@NicolasT
Copy link

commented Aug 22, 2019

This commit handles #81725: when specifying matchFields in the
nodeSelectorTerm field of a PersistentVolume, scheduling of a Pod
using a PersistentVolumeClaim which should match against such
PersistentVolume fails when the bindingMode of the corresponding
StorageClass is WaitForFirstConsumer.

This is caused by the scheduler predicates (indirectly) not passing a
Nodes 'fields' to the check for compatibility between the
PeristentVolume and said Node, hence the matchFields never...
'matching'.

`PersistentVolume`s with `matchFields` in their `nodeSelectorTerm`s are
now properly handled when using `bindingMode` `WaitForFirstConsumer`.

/sig scheduling
/sig storage
/kind bug

See: #81725

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2019

Welcome @NicolasT!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2019

Hi @NicolasT. 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 /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.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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 requested review from cofyc and dims Aug 22, 2019
@NicolasT NicolasT force-pushed the scality:GH-81725 branch 2 times, most recently from b0c5286 to 9f1b095 Aug 22, 2019
@NicolasT

This comment has been minimized.

Copy link
Author

commented Aug 22, 2019

/assign @saad-ali @vishh

@@ -40,6 +40,7 @@ import (
"k8s.io/kubernetes/pkg/kubelet/mountpod"
"k8s.io/kubernetes/pkg/kubelet/secret"
"k8s.io/kubernetes/pkg/kubelet/token"
"k8s.io/kubernetes/pkg/scheduler/algorithm"

This comment has been minimized.

Copy link
@NicolasT

NicolasT Aug 22, 2019

Author

For reviewers: not sure this can be imported here. However, if not, NodeFieldSelectorKeys needs to be moved elsewhere (but then where?).

if err != nil {
return nil, fmt.Errorf("error retrieving node: %v", err)
}
nodeFields := map[string]string{}

This comment has been minimized.

Copy link
@NicolasT

NicolasT Aug 22, 2019

Author

For reviewers: this code is now duplicated a couple of times across the codebase. It could make sense to factor it out, but then where should such utility function live? It should have access to NodeFieldSelectorKeys as well, so may make sense to keep 'closeby'.

@msau42

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

/ok-to-test

@msau42

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

Is there a reason why hostname label is not sufficient and you also need nodename field?

@msau42

This comment has been minimized.

Copy link
Member

commented Aug 22, 2019

/assign

@NicolasT

This comment has been minimized.

Copy link
Author

commented Aug 22, 2019

Is there a reason why hostname label is not sufficient and you also need nodename field?

Not necessarily, however, we consider a hostname to be something that could, at least in theory, change over time (and then kubelet will update the related Node label I believe), which doesn't play well with local PersistentVolumes. The metadata.name of a Node, however, is constant over time.

@NicolasT NicolasT force-pushed the scality:GH-81725 branch from 9f1b095 to 90891f2 Aug 22, 2019
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Aug 22, 2019

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: NicolasT
To complete the pull request process, please assign msau42, vishh
You can assign the PR to them by writing /assign @msau42 @vishh in a comment when ready.

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

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@NicolasT NicolasT force-pushed the scality:GH-81725 branch 2 times, most recently from 5fdbbf2 to 9e65127 Aug 22, 2019
This commit handles #81725: when specifying `matchFields` in the
`nodeSelectorTerm` field of a `PersistentVolume`, scheduling of a `Pod`
using a `PersistentVolumeClaim` which should match against such
`PersistentVolume` fails when the `bindingMode` of the corresponding
`StorageClass` is `WaitForFirstConsumer`.

This is caused by the scheduler predicates (indirectly) not passing a
`Node`s 'fields' to the check for compatibility between the
`PeristentVolume` and said `Node`, hence the `matchFields` never...
'matching'.

```release-note
`PersistentVolume`s with `matchFields` in their `nodeSelectorTerm`s are
now properly handled when using `bindingMode` `WaitForFirstConsumer`.
```

/sig scheduling
/sig storage
/kind bug

See: #81725
@NicolasT NicolasT force-pushed the scality:GH-81725 branch from 9e65127 to 03e4400 Aug 22, 2019
@k8s-ci-robot k8s-ci-robot added size/L and removed size/M labels Aug 22, 2019
@NicolasT

This comment has been minimized.

Copy link
Author

commented Aug 23, 2019

/assign @msau42 @vishh

@dims

This comment has been minimized.

Copy link
Member

commented Aug 25, 2019

/uncc

@k8s-ci-robot k8s-ci-robot removed the request for review from dims Aug 25, 2019
@NicolasT

This comment has been minimized.

Copy link
Author

commented Aug 26, 2019

@msau42 Anything I can do to move this (or discussion on #81725) forward? Thanks!

@xmudrii

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

@kubernetes/sig-storage-pr-reviews @kubernetes/sig-scheduling-pr-reviews Hello! I'm the bug triage lead for the 1.16 release cycle and I'm wondering are you interested to push this PR for the 1.16 release cycle or leave it for 1.17. I just want to remind that the code freeze starts on Thursday PST EOD and once it starts, only release-blocking PRs will be considered for merging.

@msau42

This comment has been minimized.

Copy link
Member

commented Aug 27, 2019

This is on my list to review post code-freeze

@NicolasT

This comment has been minimized.

Copy link
Author

commented Aug 27, 2019

Thanks @msau42! Looking forward to get this integrated in 1.17 then.

@NicolasT

This comment has been minimized.

Copy link
Author

commented Oct 10, 2019

@msau42 Ping 😃 Any chance you can take a look at this? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.