-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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 a deprecated cmd flag for the time interval between flushing pods from unschedualbeQ to activeQ or backoffQ. #108017
Conversation
@denkensk: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
// unschedulableQ. If a pod stays in unschedulableQ for longer than this | ||
// value, the pod will be moved from unschedulableQ to backoffQ or activeQ. | ||
// If this value is empty, the default value (60s) will be used. | ||
PodMaxUnscheduleQDuration metav1.Duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not move this to ComponentConfig? There is a similar field there
kubernetes/pkg/scheduler/apis/config/types.go
Lines 85 to 88 in 2047936
// PodMaxBackoffSeconds is the max backoff for unschedulable pods. | |
// If specified, it must be greater than or equal to podInitialBackoffSeconds. If this value is null, | |
// the default value (10s) will be used. | |
PodMaxBackoffSeconds int64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a command line flag with a deprecated notice from the beginning. It will be deleted in the future. So I want to keep it independent of CC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it.
@@ -170,6 +175,7 @@ type priorityQueueOptions struct { | |||
clock util.Clock | |||
podInitialBackoffDuration time.Duration | |||
podMaxBackoffDuration time.Duration | |||
podMaxUnscheduleQDuration time.Duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rename this to podMaxUnschedulableDuration, to keep the consistent style as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done podMaxUnscheduleQDuration --> podMaxUnschedulableQDuration
@@ -297,6 +297,9 @@ func (o *Options) Config() (*schedulerappconfig.Config, error) { | |||
dynClient := dynamic.NewForConfigOrDie(kubeConfig) | |||
c.DynInformerFactory = dynamicinformer.NewFilteredDynamicSharedInformerFactory(dynClient, 0, corev1.NamespaceAll, nil) | |||
c.LeaderElection = leaderElectionConfig | |||
if o.Deprecated != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't we move this to here, as --config
not specified.
kubernetes/cmd/kube-scheduler/app/options/options.go
Lines 110 to 141 in 2047936
// ApplyDeprecated obtains the deprecated CLI args and set them to `o.ComponentConfig` if specified. | |
func (o *Options) ApplyDeprecated() { | |
if o.Flags == nil { | |
return | |
} | |
// Obtain deprecated CLI args. Set them to cfg if specified in command line. | |
deprecated := o.Flags.FlagSet("deprecated") | |
if deprecated.Changed("profiling") { | |
o.ComponentConfig.EnableProfiling = o.Deprecated.EnableProfiling | |
} | |
if deprecated.Changed("contention-profiling") { | |
o.ComponentConfig.EnableContentionProfiling = o.Deprecated.EnableContentionProfiling | |
} | |
if deprecated.Changed("kubeconfig") { | |
o.ComponentConfig.ClientConnection.Kubeconfig = o.Deprecated.Kubeconfig | |
} | |
if deprecated.Changed("kube-api-content-type") { | |
o.ComponentConfig.ClientConnection.ContentType = o.Deprecated.ContentType | |
} | |
if deprecated.Changed("kube-api-qps") { | |
o.ComponentConfig.ClientConnection.QPS = o.Deprecated.QPS | |
} | |
if deprecated.Changed("kube-api-burst") { | |
o.ComponentConfig.ClientConnection.Burst = o.Deprecated.Burst | |
} | |
if deprecated.Changed("lock-object-namespace") { | |
o.ComponentConfig.LeaderElection.ResourceNamespace = o.Deprecated.ResourceNamespace | |
} | |
if deprecated.Changed("lock-object-name") { | |
o.ComponentConfig.LeaderElection.ResourceName = o.Deprecated.ResourceName | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is just used to set to CC。
Hi @denkensk , I commented for several places, but I'm not sure whether I understood your thoughts correctly, so if not, please correct me. Thanks a lot. |
2b67d81
to
ab7d3dc
Compare
/retest-required |
/assign @alculquicondor |
// unschedulableQ. If a pod stays in unschedulableQ for longer than this | ||
// value, the pod will be moved from unschedulableQ to backoffQ or activeQ. | ||
// If this value is empty, the default value (60s) will be used. | ||
PodMaxUnschedulableQDuration metav1.Duration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just use time.Duration
, because this is not an API.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -44,4 +52,5 @@ func (o *DeprecatedOptions) AddFlags(fs *pflag.FlagSet) { | |||
fs.Int32Var(&o.Burst, "kube-api-burst", 100, "DEPRECATED: burst to use while talking with kubernetes apiserver. This parameter is ignored if a config file is specified in --config.") | |||
fs.StringVar(&o.ResourceNamespace, "lock-object-namespace", "kube-system", "DEPRECATED: define the namespace of the lock object. Will be removed in favor of leader-elect-resource-namespace. This parameter is ignored if a config file is specified in --config.") | |||
fs.StringVar(&o.ResourceName, "lock-object-name", "kube-scheduler", "DEPRECATED: define the name of the lock object. Will be removed in favor of leader-elect-resource-name. This parameter is ignored if a config file is specified in --config.") | |||
fs.DurationVar(&o.PodMaxUnschedulableQDuration.Duration, "pod-max-unschedulableq-duration", 60*time.Second, "DEPRECATED: the maximum time a pod can stay in unschedulableQ. If a pod stays in unschedulableQ for longer than this value, the pod will be moved from unschedulableQ to backoffQ or activeQ. will be removed once the mechanism for flushing pods from unschedulableQ to backoffQ or activeQ has been removed.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's put an estimate: Will be removed in 1.26.
Avoid talking about internal fields in the user documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated
@@ -231,6 +233,11 @@ func (o *Options) ApplyTo(c *schedulerappconfig.Config) error { | |||
} | |||
} | |||
o.Metrics.Apply() | |||
|
|||
if o.Deprecated != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a comment about why this is not part of ApplyDeprecated.
Presumably because this can't be configured via ComponentConfig.
// for longer than this value, the pod will be moved from unschedulableQ to | ||
// backoffQ or activeQ. If this value is empty, the default value (60s) | ||
// will be used. | ||
DefaultPodMaxUnschedulableQDuration time.Duration = 60 * time.Second |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We agreed to increase the default. Are you doing that in a separate PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. It is planed to be updated in a separate PR.
/test pull-kubernetes-e2e-kind |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can squash
572a3d7
to
8754920
Compare
Thanks. Squashed. @alculquicondor |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alculquicondor, denkensk 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
#87850 (comment)
Which issue(s) this PR fixes:
The first part of #87850
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: