Skip to content

Support for NodeSelector and Tolerations.#3467

Closed
markusthoemmes wants to merge 1 commit intoknative:masterfrom
markusthoemmes:rev-scheduling
Closed

Support for NodeSelector and Tolerations.#3467
markusthoemmes wants to merge 1 commit intoknative:masterfrom
markusthoemmes:rev-scheduling

Conversation

@markusthoemmes
Copy link
Contributor

Fixes #1816
Closes #1831

Took this over from @krancour to rebase to master and push it through.

Proposed Changes

  • Support for nodeSelector and tolerations in revision spec

Release Note

Support for nodeSelector and tolerations in revision spec

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

ℹ️ Googlers: Go here for more info.

@knative-prow-robot knative-prow-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. area/API API objects and controllers labels Mar 20, 2019
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@markusthoemmes: 0 warnings.

Details

In response to this:

Fixes #1816
Closes #1831

Took this over from @krancour to rebase to master and push it through.

Proposed Changes

  • Support for nodeSelector and tolerations in revision spec

Release Note

Support for nodeSelector and tolerations in revision spec

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.

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: markusthoemmes
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: mattmoor

If they are not already assigned, you can assign the PR to them by writing /assign @mattmoor in a comment when ready.

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

The pull request process is described here

Details 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

@markusthoemmes
Copy link
Contributor Author

/assign @mattmoor

I think this needs superpowers to merge.

@krancour
Copy link
Contributor

Confirming that I'm good with this PR that includes my commits. Is there a slash command to convey that??

Co-authored-by: Markus Thömmes <markusthoemmes@me.com>
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/revision_validation.go 96.5% 97.1% 0.6

@dgerd
Copy link

dgerd commented Mar 20, 2019

Confirming that I'm good with this PR that includes my commits. Is there a slash command to convey that??

There is no slash command. It requires a project owner to override the bot and make the merge happen as Markus suggested.

@markusthoemmes
Copy link
Contributor Author

/test pull-knative-serving-upgrade-tests

2 similar comments
@markusthoemmes
Copy link
Contributor Author

/test pull-knative-serving-upgrade-tests

@markusthoemmes
Copy link
Contributor Author

/test pull-knative-serving-upgrade-tests

@markusthoemmes
Copy link
Contributor Author

Can't wait for the 0.5 release...

/test pull-knative-serving-upgrade-tests

@markusthoemmes
Copy link
Contributor Author

/test pull-knative-serving-upgrade-tests

@mattmoor
Copy link
Member

I'm not sure we ever adequately discussed this at the WG (or v1beta1 task force), and I know this makes a number of folks uneasy (myself included). Nodeful concepts like these feel like really leaky Ops abstractions to allow in our API.

I'll add this to the taskforce backlog.

Paths: []string{"operator"},
}
}
// validate toleration effect, empty toleration effect means match all taint
Copy link
Member

Choose a reason for hiding this comment

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

// k8s.io/kubernetes/pkg/apis/core/validation. Although relevant functions from
// that package are exported, they're not usable here because they are for
// unversioned resources.
func validateToleration(toleration corev1.Toleration) *apis.FieldError {
Copy link
Member

Choose a reason for hiding this comment

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

}

if err := validateNodeSelector(rs.NodeSelector); err != nil {
return err.ViaField("nodeSelector")
Copy link
Member

Choose a reason for hiding this comment

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

Append to errs instead of returning?

}
for i, toleration := range rs.Tolerations {
if err := validateToleration(toleration); err != nil {
return err.ViaField(
Copy link
Member

Choose a reason for hiding this comment

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

Append to errs instead of returning?

ServiceAccountName: rev.Spec.ServiceAccountName,
TerminationGracePeriodSeconds: &revisionTimeout,
NodeSelector: rev.Spec.NodeSelector,
Tolerations: rev.Spec.Tolerations,
Copy link
Member

Choose a reason for hiding this comment

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

Can we confirm these are mutable.

If not we will need changes to the checkAndUpdateDeployment logic here:

// Preserve the label selector since it's immutable.
// TODO(dprotaso): determine other immutable properties.
deployment.Spec.Selector = have.Spec.Selector

@markusthoemmes
Copy link
Contributor Author

Closing this for now until we have stronger opinions on really needing this.

@kaleo211
Copy link

This is a nice feature to have :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/API API objects and controllers 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.

Using nodeSelector/tolerations with Serving?

9 participants