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

add non-preempting option to PriorityClasses #74614

Merged
merged 2 commits into from May 31, 2019

Conversation

@denkensk
Copy link
Member

commented Feb 26, 2019

What type of PR is this?
/kind feature
/priority important-soon

What this PR does / why we need it:
Adds a NonPrempting field to the PriorityClass. If set on a class, it will continue to be prioritized above queued pods of a lesser class, but will not preempt running pods.

Which issue(s) this PR fixes:
Fixes #67671
kubernetes/enhancements#902

Add  NonPrempting field to the PriorityClass.
Show resolved Hide resolved cmd/kube-scheduler/app/server.go Outdated
@@ -42,5 +42,5 @@ func init() {
// We only register manually written functions here. The registration of the
// generated functions takes place in the generated files. The separation
// makes the code compile even when the generated files are missing.
localSchemeBuilder.Register(RegisterDefaults)
localSchemeBuilder.Register(addDefaultingFuncs)

This comment has been minimized.

Copy link
@yastij

yastij Mar 4, 2019

Member

same here, the regitration for defaults should be under v1 ?

@liggitt liggitt removed sig/auth labels Mar 6, 2019

@denkensk denkensk changed the title [WIP] No preempting priority [WIP] add non-preempting option to PriorityClasses Mar 21, 2019

@denkensk denkensk force-pushed the denkensk:no-preempting-priority branch from 23151be to cfc3970 Mar 28, 2019

@denkensk denkensk force-pushed the denkensk:no-preempting-priority branch from cfc3970 to dadb9fd Mar 28, 2019

@liggitt liggitt referenced this pull request May 30, 2019

Merged

Add json/protobuf/yaml fixtures #78309

2 of 7 tasks complete

@denkensk denkensk force-pushed the denkensk:no-preempting-priority branch from cf92746 to 912a422 May 30, 2019

@denkensk

This comment has been minimized.

Copy link
Member Author

commented May 30, 2019

/retest

@denkensk denkensk force-pushed the denkensk:no-preempting-priority branch from 912a422 to d7af3ef May 30, 2019

@@ -41,6 +41,9 @@ func ValidatePriorityClass(pc *scheduling.PriorityClass) field.ErrorList {
// Non-system critical priority classes are not allowed to have a value larger than HighestUserDefinablePriority.
allErrs = append(allErrs, field.Forbidden(field.NewPath("value"), fmt.Sprintf("maximum allowed value of a user defined priority is %v", scheduling.HighestUserDefinablePriority)))
}
if pc.PreemptionPolicy != nil {
allErrs = append(allErrs, apivalidation.ValidatePreemptionPolicy(pc.PreemptionPolicy, field.NewPath("PreemptionPolicy"))...)

This comment has been minimized.

Copy link
@liggitt

liggitt May 30, 2019

Member

"preemptionPolicy", since this is shown to the user and should match the serialized field name

@@ -52,5 +55,7 @@ func ValidatePriorityClassUpdate(pc, oldPc *scheduling.PriorityClass) field.Erro
if pc.Value != oldPc.Value {
allErrs = append(allErrs, field.Forbidden(field.NewPath("Value"), "may not be changed in an update."))
}
// PreemptionPolicy is immutable and is checked by the ObjectMeta validator.
allErrs = append(allErrs, apivalidation.ValidateImmutableField(pc.PreemptionPolicy, oldPc.PreemptionPolicy, field.NewPath("PreemptionPolicy"))...)

This comment has been minimized.

Copy link
@liggitt

liggitt May 30, 2019

Member

"preemptionPolicy", since this is shown to the user and should match the serialized field name


cmd.Flags().Int32("value", 0, i18n.T("the value of this priority class."))
cmd.Flags().Bool("global-default", false, i18n.T("global-default specifies whether this PriorityClass should be considered as the default priority."))
cmd.Flags().String("description", "", i18n.T("description is an arbitrary string that usually provides guidelines on when this priority class should be used."))
cmd.Flags().String("preemption-policy", "PreemptLowerPriority", i18n.T("preemption-policy is the policy for preempting pods with lower priority."))

This comment has been minimized.

Copy link
@liggitt

liggitt May 30, 2019

Member

don't specify a default for alpha fields

@liggitt

This comment has been minimized.

Copy link
Member

commented May 30, 2019

verify test requires single-line invocations of SetFeatureGateDuringTest:

Invalid invocations of featuregatetesting.SetFeatureGateDuringTest():
./pkg/apis/scheduling/v1/defaults_test.go:60:	defer featuregatetesting.SetFeatureGateDuringTest(nil, utilfeature.DefaultFeatureGate,
./pkg/apis/scheduling/v1beta1/defaults_test.go:60:	defer featuregatetesting.SetFeatureGateDuringTest(nil, utilfeature.DefaultFeatureGate,
./pkg/apis/scheduling/v1alpha1/defaults_test.go:60:	defer featuregatetesting.SetFeatureGateDuringTest(nil, utilfeature.DefaultFeatureGate,

Always make a deferred call to the returned function to ensure the feature gate is reset:
  defer featuregatetesting.SetFeatureGateDuringTest(t, utilfeature.DefaultFeatureGate, features.<FeatureName>, <value>)()
@liggitt

This comment has been minimized.

Copy link
Member

commented May 30, 2019

a few last comments and the verify test fixup, then this LGTM. thanks for all the work

@liggitt

This comment has been minimized.

Copy link
Member

commented May 30, 2019

/approve

API changes look good. needs a squash then lgtm

@liggitt liggitt moved this from Changes requested to Completed, 1.15 in API Reviews May 30, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented May 30, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bsalamat, denkensk, liggitt

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

The pull request process is described 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

@denkensk denkensk force-pushed the denkensk:no-preempting-priority branch from 08393b8 to 5e3e7ba May 30, 2019

@liggitt

This comment has been minimized.

Copy link
Member

commented May 30, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label May 30, 2019

@denkensk

This comment has been minimized.

Copy link
Member Author

commented May 30, 2019

/retest

@denkensk

This comment has been minimized.

Copy link
Member Author

commented May 30, 2019

/test pull-kubernetes-e2e-gce-100-performance

1 similar comment
@BenTheElder

This comment has been minimized.

Copy link
Member

commented May 30, 2019

/test pull-kubernetes-e2e-gce-100-performance

denkensk and others added some commits Apr 2, 2019

non-preempting-priorityclass
Co-authored-by: Vallery Lancey <vallery@zeitgeistlabs.io>
Co-authored-by: Tan shanshan <tan.shanshan@zte.com.cn>

@denkensk denkensk force-pushed the denkensk:no-preempting-priority branch from 5e3e7ba to 52f3380 May 31, 2019

@k8s-ci-robot k8s-ci-robot removed the lgtm label May 31, 2019

@denkensk

This comment has been minimized.

Copy link
Member Author

commented May 31, 2019

Just rebase in "pkg/features/kube_features.go" @bsalamat @liggitt need lgtm again?

@vllry

This comment has been minimized.

Copy link
Contributor

commented May 31, 2019

/lgtm

@denkensk

This comment has been minimized.

Copy link
Member Author

commented May 31, 2019

/retest

@k8s-ci-robot k8s-ci-robot merged commit 6c42729 into kubernetes:master May 31, 2019

21 checks passed

cla/linuxfoundation denkensk authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-node-e2e-containerd Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
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.