k8s.io/kubernetes@v1.31.0-alpha.0.0.20240520171757-56147500dadc/cmd/kube-scheduler/app/options/deprecated.go (about)

     1  /*
     2  Copyright 2018 The Kubernetes Authors.
     3  
     4  Licensed under the Apache License, Version 2.0 (the "License");
     5  you may not use this file except in compliance with the License.
     6  You may obtain a copy of the License at
     7  
     8      http://www.apache.org/licenses/LICENSE-2.0
     9  
    10  Unless required by applicable law or agreed to in writing, software
    11  distributed under the License is distributed on an "AS IS" BASIS,
    12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    13  See the License for the specific language governing permissions and
    14  limitations under the License.
    15  */
    16  
    17  package options
    18  
    19  import (
    20  	"time"
    21  
    22  	"github.com/spf13/pflag"
    23  	componentbaseconfig "k8s.io/component-base/config"
    24  )
    25  
    26  // DeprecatedOptions contains deprecated options and their flags.
    27  // TODO remove these fields once the deprecated flags are removed.
    28  type DeprecatedOptions struct {
    29  	componentbaseconfig.DebuggingConfiguration
    30  	componentbaseconfig.ClientConnectionConfiguration
    31  	// PodMaxInUnschedulablePodsDuration is the maximum time a pod can stay in
    32  	// unschedulablePods. If a pod stays in unschedulablePods for longer than this
    33  	// value, the pod will be moved from unschedulablePods to backoffQ or activeQ.
    34  	// If this value is empty, the default value (5min) will be used.
    35  	PodMaxInUnschedulablePodsDuration time.Duration
    36  }
    37  
    38  // AddFlags adds flags for the deprecated options.
    39  func (o *DeprecatedOptions) AddFlags(fs *pflag.FlagSet) {
    40  	if o == nil {
    41  		return
    42  	}
    43  
    44  	fs.BoolVar(&o.EnableProfiling, "profiling", true, "DEPRECATED: enable profiling via web interface host:port/debug/pprof/. This parameter is ignored if a config file is specified in --config.")
    45  	fs.BoolVar(&o.EnableContentionProfiling, "contention-profiling", true, "DEPRECATED: enable block profiling, if profiling is enabled. This parameter is ignored if a config file is specified in --config.")
    46  	fs.StringVar(&o.Kubeconfig, "kubeconfig", "", "DEPRECATED: path to kubeconfig file with authorization and master location information. This parameter is ignored if a config file is specified in --config.")
    47  	fs.StringVar(&o.ContentType, "kube-api-content-type", "application/vnd.kubernetes.protobuf", "DEPRECATED: content type of requests sent to apiserver. This parameter is ignored if a config file is specified in --config.")
    48  	fs.Float32Var(&o.QPS, "kube-api-qps", 50.0, "DEPRECATED: QPS to use while talking with kubernetes apiserver. This parameter is ignored if a config file is specified in --config.")
    49  	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.")
    50  	// We found an issue(https://github.com/kubernetes/kubernetes/issues/110175) in which Pods can be stuck in the unschedulable pod pool for 5 min, and using this flag is the only workaround for this issue.
    51  	// This issue only could happen if you use custom plugins or if you change plugin set being used in your scheduler via the scheduler config.
    52  	// TODO: remove this flag once https://github.com/kubernetes/kubernetes/issues/110175 is done.
    53  	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 a future version.")
    54  }