@@ -18,6 +18,7 @@ package config
18
18
19
19
import (
20
20
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
21
+ "k8s.io/apimachinery/pkg/runtime"
21
22
componentbaseconfig "k8s.io/component-base/config"
22
23
)
23
24
@@ -86,6 +87,17 @@ type KubeSchedulerConfiguration struct {
86
87
// Value must be non-negative integer. The value zero indicates no waiting.
87
88
// If this value is nil, the default value will be used.
88
89
BindTimeoutSeconds * int64
90
+
91
+ // Plugins specify the set of plugins that should be enabled or disabled. Enabled plugins are the
92
+ // ones that should be enabled in addition to the default plugins. Disabled plugins are any of the
93
+ // default plugins that should be disabled.
94
+ // When no enabled or disabled plugin is specified for an extension point, default plugins for
95
+ // that extension point will be used if there is any.
96
+ Plugins * Plugins
97
+
98
+ // PluginConfig is an optional set of custom plugin arguments for each plugin.
99
+ // Omitting config args for a plugin is equivalent to using the default config for that plugin.
100
+ PluginConfig []PluginConfig
89
101
}
90
102
91
103
// SchedulerAlgorithmSource is the source of a scheduler algorithm. One source
@@ -131,3 +143,76 @@ type KubeSchedulerLeaderElectionConfiguration struct {
131
143
// LockObjectName defines the lock object name
132
144
LockObjectName string
133
145
}
146
+
147
+ // Plugins include multiple extension points. When specified, the list of plugins for
148
+ // a particular extension point are the only ones enabled. If an extension point is
149
+ // omitted from the config, then the default set of plugins is used for that extension point.
150
+ // Enabled plugins are called in the order specified here, after default plugins. If they need to
151
+ // be invoked before default plugins, default plugins must be disabled and re-enabled here in desired order.
152
+ type Plugins struct {
153
+ // QueueSort is a list of plugins that should be invoked when sorting pods in the scheduling queue.
154
+ QueueSort * PluginSet
155
+
156
+ // PreFilter is a list of plugins that should be invoked at "PreFilter" extension point of the scheduling framework.
157
+ PreFilter * PluginSet
158
+
159
+ // Filter is a list of plugins that should be invoked when filtering out nodes that cannot run the Pod.
160
+ Filter * PluginSet
161
+
162
+ // PostFilter is a list of plugins that are invoked after filtering out infeasible nodes.
163
+ PostFilter * PluginSet
164
+
165
+ // Score is a list of plugins that should be invoked when ranking nodes that have passed the filtering phase.
166
+ Score * PluginSet
167
+
168
+ // NormalizeScore is a list of plugins that should be invoked after the scoring phase to normalize scores.
169
+ NormalizeScore * PluginSet
170
+
171
+ // Reserve is a list of plugins invoked when reserving a node to run the pod.
172
+ Reserve * PluginSet
173
+
174
+ // Permit is a list of plugins that control binding of a Pod. These plugins can prevent or delay binding of a Pod.
175
+ Permit * PluginSet
176
+
177
+ // PreBind is a list of plugins that should be invoked before a pod is bound.
178
+ PreBind * PluginSet
179
+
180
+ // Bind is a list of plugins that should be invoked at "Bind" extension point of the scheduling framework.
181
+ // The scheduler call these plugins in order. Scheduler skips the rest of these plugins as soon as one returns success.
182
+ Bind * PluginSet
183
+
184
+ // PostBind is a list of plugins that should be invoked after a pod is successfully bound.
185
+ PostBind * PluginSet
186
+
187
+ // Unreserve is a list of plugins invoked when a pod that was previously reserved is rejected in a later phase.
188
+ Unreserve * PluginSet
189
+ }
190
+
191
+ // PluginSet specifies enabled and disabled plugins for an extension point.
192
+ // If an array is empty, missing, or nil, default plugins at that extension point will be used.
193
+ type PluginSet struct {
194
+ // Enabled specifies plugins that should be enabled in addition to default plugins.
195
+ // These are called after default plugins and in the same order specified here.
196
+ Enabled []Plugin
197
+ // Disabled specifies default plugins that should be disabled.
198
+ // When all default plugins need to be disabled, an array containing only one "*" should be provided.
199
+ Disabled []Plugin
200
+ }
201
+
202
+ // Plugin specifies a plugin name and its weight when applicable. Weight is used only for Score plugins.
203
+ type Plugin struct {
204
+ // Name defines the name of plugin
205
+ Name string
206
+ // Weight defines the weight of plugin, only used for Score plugins.
207
+ Weight int32
208
+ }
209
+
210
+ // PluginConfig specifies arguments that should be passed to a plugin at the time of initialization.
211
+ // A plugin that is invoked at multiple extension points is initialized once. Args can have arbitrary structure.
212
+ // It is up to the plugin to process these Args.
213
+ type PluginConfig struct {
214
+ // Name defines the name of plugin being configured
215
+ Name string
216
+ // Args defines the arguments passed to the plugins at the time of initialization. Args can have arbitrary structure.
217
+ Args runtime.Unknown
218
+ }
0 commit comments