package options
import "k8s.io/kubernetes/cmd/kube-scheduler/app/options"
Index ¶
- func LoadConfigFromFile(logger klog.Logger, file string) (*config.KubeSchedulerConfiguration, error)
- func LogOrWriteConfig(logger klog.Logger, fileName string, cfg *config.KubeSchedulerConfiguration, completedProfiles []config.KubeSchedulerProfile) error
- type DeprecatedOptions
- type Options
- func NewOptions() *Options
- func NewOptionsWithComponentGlobalsRegistry(componentGlobalsRegistry basecompatibility.ComponentGlobalsRegistry) *Options
- func (o *Options) ApplyDeprecated()
- func (o *Options) ApplyLeaderElectionTo(cfg *kubeschedulerconfig.KubeSchedulerConfiguration)
- func (o *Options) ApplyTo(logger klog.Logger, c *schedulerappconfig.Config) error
- func (o *Options) Config(ctx context.Context) (*schedulerappconfig.Config, error)
- func (o *Options) Validate() []error
Functions ¶
func LoadConfigFromFile ¶
func LoadConfigFromFile(logger klog.Logger, file string) (*config.KubeSchedulerConfiguration, error)
LoadConfigFromFile loads scheduler config from the specified file path
func LogOrWriteConfig ¶
func LogOrWriteConfig(logger klog.Logger, fileName string, cfg *config.KubeSchedulerConfiguration, completedProfiles []config.KubeSchedulerProfile) error
LogOrWriteConfig logs the completed component config and writes it into the given file name as YAML, if either is enabled
Types ¶
type DeprecatedOptions ¶
type DeprecatedOptions struct { componentbaseconfig.DebuggingConfiguration componentbaseconfig.ClientConnectionConfiguration // 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 }
DeprecatedOptions contains deprecated options and their flags. TODO remove these fields once the deprecated flags are removed.
func (*DeprecatedOptions) AddFlags ¶
func (o *DeprecatedOptions) AddFlags(fs *pflag.FlagSet)
AddFlags adds flags for the deprecated options.
type Options ¶
type Options struct { // The default values. ComponentConfig *kubeschedulerconfig.KubeSchedulerConfiguration SecureServing *apiserveroptions.SecureServingOptionsWithLoopback Authentication *apiserveroptions.DelegatingAuthenticationOptions Authorization *apiserveroptions.DelegatingAuthorizationOptions Metrics *metrics.Options Logs *logs.Options Deprecated *DeprecatedOptions LeaderElection *componentbaseconfig.LeaderElectionConfiguration // ConfigFile is the location of the scheduler server's configuration file. ConfigFile string // WriteConfigTo is the path where the default configuration will be written. WriteConfigTo string Master string // ComponentGlobalsRegistry is the registry where the effective versions and feature gates for all components are stored. ComponentGlobalsRegistry basecompatibility.ComponentGlobalsRegistry // Flags hold the parsed CLI flags. Flags *cliflag.NamedFlagSets }
Options has all the params needed to run a Scheduler
func NewOptions ¶
func NewOptions() *Options
NewOptions returns default scheduler app options.
func NewOptionsWithComponentGlobalsRegistry ¶
func NewOptionsWithComponentGlobalsRegistry(componentGlobalsRegistry basecompatibility.ComponentGlobalsRegistry) *Options
func (*Options) ApplyDeprecated ¶
func (o *Options) ApplyDeprecated()
ApplyDeprecated obtains the deprecated CLI args and set them to `o.ComponentConfig` if specified.
func (*Options) ApplyLeaderElectionTo ¶
func (o *Options) ApplyLeaderElectionTo(cfg *kubeschedulerconfig.KubeSchedulerConfiguration)
ApplyLeaderElectionTo obtains the CLI args related with leaderelection, and override the values in `cfg`. Then the `cfg` object is injected into the `options` object.
func (*Options) ApplyTo ¶
func (o *Options) ApplyTo(logger klog.Logger, c *schedulerappconfig.Config) error
ApplyTo applies the scheduler options to the given scheduler app configuration.
func (*Options) Config ¶
Config return a scheduler config object
func (*Options) Validate ¶
Validate validates all the required options.
Source Files ¶
configfile.go deprecated.go options.go
- Version
- v1.33.0 (latest)
- Published
- Apr 23, 2025
- Platform
- linux/amd64
- Imports
- 42 packages
- Last checked
- 5 hours ago –
Tools for package owners.