<p>The version of Kubernetes in use is v1.26.3.</p>
<p>I have cloned the Kubernetes source code to peruse the scheduler logic.</p>
<p>Upon inspection of the framework.go file, I have observed the existence of a frameworkImpl struct. I am curious as to how I can ascertain which plugins have been registered.</p>
<pre><code>

I am curious as to how I can ascertain which plugins have been registered
// NewFramework initializes plugins given the configuration and the registry.
func NewFramework(r Registry, profile *config.KubeSchedulerProfile, stopCh &lt;-chan struct{}, opts ...Option) (framework.Framework, error) {
    options := defaultFrameworkOptions(stopCh)
    for _, opt := range opts {
        opt(&amp;options)
    }

    f := &amp;frameworkImpl{
        registry:             r,
        snapshotSharedLister: options.snapshotSharedLister,
        scorePluginWeight:    make(map[string]int),
        waitingPods:          newWaitingPodsMap(),
        clientSet:            options.clientSet,
        kubeConfig:           options.kubeConfig,
        eventRecorder:        options.eventRecorder,
        informerFactory:      options.informerFactory,
        metricsRecorder:      options.metricsRecorder,
        extenders:            options.extenders,
        PodNominator:         options.podNominator,
        parallelizer:         options.parallelizer,
    }

    if profile == nil {
        return f, nil
    }

    f.profileName = profile.SchedulerName
    f.percentageOfNodesToScore = profile.PercentageOfNodesToScore
    if profile.Plugins == nil {
        return f, nil
    }

    // get needed plugins from config
    pg := f.pluginsNeeded(profile.Plugins)

    pluginConfig := make(map[string]runtime.Object, len(profile.PluginConfig))
    for i := range profile.PluginConfig {
        name := profile.PluginConfig[i].Name
        if _, ok := pluginConfig[name]; ok {
            return nil, fmt.Errorf(&quot;repeated config for plugin %s&quot;, name)
        }
        pluginConfig[name] = profile.PluginConfig[i].Args
    }
    outputProfile := config.KubeSchedulerProfile{
        SchedulerName:            f.profileName,
        PercentageOfNodesToScore: f.percentageOfNodesToScore,
        Plugins:                  profile.Plugins,
        PluginConfig:             make([]config.PluginConfig, 0, len(pg)),
    }

    pluginsMap := make(map[string]framework.Plugin)
    for name, factory := range r {
        // initialize only needed plugins.
        if !pg.Has(name) {
            continue
        }

        args := pluginConfig[name]
        if args != nil {
            outputProfile.PluginConfig = append(outputProfile.PluginConfig, config.PluginConfig{
                Name: name,
                Args: args,
            })
        }
        p, err := factory(args, f)
        if err != nil {
            return nil, fmt.Errorf(&quot;initializing plugin %q: %w&quot;, name, err)
        }
        pluginsMap[name] = p

        // Update ClusterEventMap in place.
        fillEventToPluginMap(p, options.clusterEventMap)
    }

    // initialize plugins per individual extension points
    for _, e := range f.getExtensionPoints(profile.Plugins) {
        if err := updatePluginList(e.slicePtr, *e.plugins, pluginsMap); err != nil {
            return nil, err
        }
    }

    // initialize multiPoint plugins to their expanded extension points
    if len(profile.Plugins.MultiPoint.Enabled) &gt; 0 {
        if err := f.expandMultiPointPlugins(profile, pluginsMap); err != nil {
            return nil, err
        }
    }

    if len(f.queueSortPlugins) != 1 {
        return nil, fmt.Errorf(&quot;only one queue sort plugin required for profile with scheduler name %q, but got %d&quot;, profile.SchedulerName, len(f.queueSortPlugins))
    }
    if len(f.bindPlugins) == 0 {
        return nil, fmt.Errorf(&quot;at least one bind plugin is needed for profile with scheduler name %q&quot;, profile.SchedulerName)
    }

    if err := getScoreWeights(f, pluginsMap, append(profile.Plugins.Score.Enabled, profile.Plugins.MultiPoint.Enabled...)); err != nil {
        return nil, err
    }

    // Verifying the score weights again since Plugin.Name() could return a different
    // value from the one used in the configuration.
    for _, scorePlugin := range f.scorePlugins {
        if f.scorePluginWeight[scorePlugin.Name()] == 0 {
            return nil, fmt.Errorf(&quot;score plugin %q is not configured with weight&quot;, scorePlugin.Name())
        }
    }

    if options.captureProfile != nil {
        if len(outputProfile.PluginConfig) != 0 {
            sort.Slice(outputProfile.PluginConfig, func(i, j int) bool {
                return outputProfile.PluginConfig[i].Name &lt; outputProfile.PluginConfig[j].Name
            })
        } else {
            outputProfile.PluginConfig = nil
        }
        options.captureProfile(outputProfile)
    }

    return f, nil
}
</code></pre>
<p>I am curious as to how I can ascertain which plugins have been registered</p>

<p>actual, i'm trying to find out what plugins are used by default too.</p>
<p>the kubernetes version i'm using is 1.20.6.</p>
<p>i found pretty hard to get the answer from source code.</p>
<p>but you can export the configuration used by scheduler isntance by adding an arugument to kube-scheduler.yaml:</p>
<ul>
<li>--write-config-to=/path/to/hostpath/config/file</li>
</ul>
<p>ATTENTIONS:</p>
<ul>
<li>--v should &gt;= 2</li>
<li>if write-config-to success, scheduler will exit 0, so remove this argument after you export config file</li>
</ul>
