Skip to content

Commit

Permalink
rename unschedulableQ to unschedulablePods
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Wang <wangqingcan1990@gmail.com>
  • Loading branch information
denkensk authored and muyangren2 committed Jul 14, 2022
1 parent 10c5f9e commit 9a82722
Show file tree
Hide file tree
Showing 12 changed files with 218 additions and 213 deletions.
10 changes: 5 additions & 5 deletions cmd/kube-scheduler/app/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ type Config struct {
// LeaderElection is optional.
LeaderElection *leaderelection.LeaderElectionConfig

// PodMaxUnschedulableQDuration is 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.
// If this value is empty, the default value (60s) will be used.
PodMaxUnschedulableQDuration time.Duration
// PodMaxInUnschedulablePodsDuration is the maximum time a pod can stay in
// unschedulablePods. If a pod stays in unschedulablePods for longer than this
// value, the pod will be moved from unschedulablePods to backoffQ or activeQ.
// If this value is empty, the default value (5min) will be used.
PodMaxInUnschedulablePodsDuration time.Duration
}

type completedConfig struct {
Expand Down
12 changes: 6 additions & 6 deletions cmd/kube-scheduler/app/options/deprecated.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ type DeprecatedOptions struct {
componentbaseconfig.ClientConnectionConfiguration
// Note that only the deprecated options (lock-object-name and lock-object-namespace) are populated here.
componentbaseconfig.LeaderElectionConfiguration
// PodMaxUnschedulableQDuration is 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.
// If this value is empty, the default value (60s) will be used.
PodMaxUnschedulableQDuration time.Duration
// PodMaxInUnschedulablePodsDuration is the maximum time a pod can stay in
// unschedulablePods. If a pod stays in unschedulablePods for longer than this
// value, the pod will be moved from unschedulablePods to backoffQ or activeQ.
// If this value is empty, the default value (5min) will be used.
PodMaxInUnschedulablePodsDuration time.Duration
}

// AddFlags adds flags for the deprecated options.
Expand All @@ -51,5 +51,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, "pod-max-unschedulableq-duration", 5*time.Minute, "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. This flag is deprecated and will be removed in 1.26")
fs.DurationVar(&o.PodMaxInUnschedulablePodsDuration, "pod-max-in-unschedulable-pods-duration", 5*time.Minute, "DEPRECATED: the maximum time a pod can stay in unschedulablePods. If a pod stays in unschedulablePods for longer than this value, the pod will be moved from unschedulablePods to backoffQ or activeQ. This flag is deprecated and will be removed in 1.26")
}
4 changes: 2 additions & 2 deletions cmd/kube-scheduler/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func NewOptions() *Options {
Authentication: apiserveroptions.NewDelegatingAuthenticationOptions(),
Authorization: apiserveroptions.NewDelegatingAuthorizationOptions(),
Deprecated: &DeprecatedOptions{
PodMaxUnschedulableQDuration: 5 * time.Minute,
PodMaxInUnschedulablePodsDuration: 5 * time.Minute,
},
LeaderElection: &componentbaseconfig.LeaderElectionConfiguration{
LeaderElect: true,
Expand Down Expand Up @@ -236,7 +236,7 @@ func (o *Options) ApplyTo(c *schedulerappconfig.Config) error {

// Apply value independently instead of using ApplyDeprecated() because it can't be configured via ComponentConfig.
if o.Deprecated != nil {
c.PodMaxUnschedulableQDuration = o.Deprecated.PodMaxUnschedulableQDuration
c.PodMaxInUnschedulablePodsDuration = o.Deprecated.PodMaxInUnschedulablePodsDuration
}

return nil
Expand Down
2 changes: 1 addition & 1 deletion cmd/kube-scheduler/app/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ func Setup(ctx context.Context, opts *options.Options, outOfTreeRegistryOptions
scheduler.WithFrameworkOutOfTreeRegistry(outOfTreeRegistry),
scheduler.WithPodMaxBackoffSeconds(cc.ComponentConfig.PodMaxBackoffSeconds),
scheduler.WithPodInitialBackoffSeconds(cc.ComponentConfig.PodInitialBackoffSeconds),
scheduler.WithPodMaxUnschedulableQDuration(cc.PodMaxUnschedulableQDuration),
scheduler.WithPodMaxInUnschedulablePodsDuration(cc.PodMaxInUnschedulablePodsDuration),
scheduler.WithExtenders(cc.ComponentConfig.Extenders...),
scheduler.WithParallelism(cc.ComponentConfig.Parallelism),
scheduler.WithBuildFrameworkCapturer(func(profile kubeschedulerconfig.KubeSchedulerProfile) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/framework/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ const (
)

// PodsToActivateKey is a reserved state key for stashing pods.
// If the stashed pods are present in unschedulableQ or backoffQ,they will be
// If the stashed pods are present in unschedulablePods or backoffQ,they will be
// activated (i.e., moved to activeQ) in two phases:
// - end of a scheduling cycle if it succeeds (will be cleared from `PodsToActivate` if activated)
// - end of a binding cycle if it succeeds
Expand Down
2 changes: 1 addition & 1 deletion pkg/scheduler/internal/queue/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const (
ScheduleAttemptFailure = "ScheduleAttemptFailure"
// BackoffComplete is the event when a pod finishes backoff.
BackoffComplete = "BackoffComplete"
// ForceActivate is the event when a pod is moved from unschedulableQ/backoffQ
// ForceActivate is the event when a pod is moved from unschedulablePods/backoffQ
// to activeQ. Usually it's triggered by plugin implementations.
ForceActivate = "ForceActivate"
)
Expand Down

0 comments on commit 9a82722

Please sign in to comment.