code: func (o *Options) Config() (*schedulerappconfig.Config, error) {
  	if o.SecureServing != nil {
  		if err := o.SecureServing.MaybeDefaultWithSelfSignedCerts("localhost", nil, []net.IP{net.ParseIP("127.0.0.1")}); err != nil {
  			return nil, fmt.Errorf("error creating self-signed certificates: %v", err)
  		}
  	}
  
  	c := &schedulerappconfig.Config{}
  	if err := o.ApplyTo(c); err != nil {
  		return nil, err
  	}
  
  	// Prepare kube clients.
  	client, leaderElectionClient, eventClient, err := createClients(c.ComponentConfig.ClientConnection, o.Master, c.ComponentConfig.LeaderElection.RenewDeadline.Duration)
  	if err != nil {
  		return nil, err
  	}
  
  	// Prepare event clients.
  	eventBroadcaster := record.NewBroadcaster()
  	recorder := eventBroadcaster.NewRecorder(legacyscheme.Scheme, corev1.EventSource{Component: c.ComponentConfig.SchedulerName})
  
  	// Set up leader election if enabled.
  	var leaderElectionConfig *leaderelection.LeaderElectionConfig
  	if c.ComponentConfig.LeaderElection.LeaderElect {
  		leaderElectionConfig, err = makeLeaderElectionConfig(c.ComponentConfig.LeaderElection, leaderElectionClient, recorder)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	c.Client = client
  	c.InformerFactory = informers.NewSharedInformerFactory(client, 0)
  	c.PodInformer = factory.NewPodInformer(client, 0)
  	c.EventClient = eventClient
  	c.Recorder = recorder
  	c.Broadcaster = eventBroadcaster
  	c.LeaderElection = leaderElectionConfig
  
  	return c, nil
  }
docs: // Config return a scheduler config object