@@ -54,16 +54,22 @@ type EndpointPickerConfig struct {
5454 // +optional
5555 // Data configures the DataLayer. It is required if the new DataLayer is enabled.
5656 Data * DataLayerConfig `json:"data"`
57+
58+ // +optional
59+ // FlowControl configures the Flow Control layer.
60+ // This configuration is only respected if the "flowControl" FeatureGate is enabled.
61+ FlowControl * FlowControlConfig `json:"flowControl,omitempty"`
5762}
5863
5964func (cfg EndpointPickerConfig ) String () string {
6065 return fmt .Sprintf (
61- "{FeatureGates: %v, Plugins: %v, SchedulingProfiles: %v, Data: %v, SaturationDetector: %v}" ,
66+ "{FeatureGates: %v, Plugins: %v, SchedulingProfiles: %v, Data: %v, SaturationDetector: %v, FlowControl: %v }" ,
6267 cfg .FeatureGates ,
6368 cfg .Plugins ,
6469 cfg .SchedulingProfiles ,
6570 cfg .Data ,
6671 cfg .SaturationDetector ,
72+ cfg .FlowControl ,
6773 )
6874}
6975
@@ -126,13 +132,13 @@ type SchedulingPlugin struct {
126132
127133 // +optional
128134 // Weight is the weight fo be used if this plugin is a Scorer.
129- Weight * int `json:"weight"`
135+ Weight * float64 `json:"weight"`
130136}
131137
132138func (sp SchedulingPlugin ) String () string {
133139 var weight string
134140 if sp .Weight != nil {
135- weight = fmt .Sprintf (", Weight: %d " , * sp .Weight )
141+ weight = fmt .Sprintf (", Weight: %f " , * sp .Weight )
136142 }
137143 return fmt .Sprintf ("{PluginRef: %s%s}" , sp .PluginRef , weight )
138144}
@@ -245,3 +251,70 @@ type DataLayerExtractor struct {
245251func (dle DataLayerExtractor ) String () string {
246252 return "{PluginRef: " + dle .PluginRef + "}"
247253}
254+
255+ // FlowControlConfig configures the Flow Control layer.
256+ type FlowControlConfig struct {
257+ // +optional
258+ // MaxBytes defines the global capacity limit for the Flow Control system.
259+ // It represents the maximum aggregate byte size of all active requests across all priority
260+ // levels. If this limit is exceeded, new requests will be rejected even if their specific
261+ // priority band has capacity.
262+ // If 0 or omitted, no global limit is enforced (unlimited).
263+ // Default: 0 (unlimited).
264+ MaxBytes * int64 `json:"maxBytes,omitempty"`
265+
266+ // +optional
267+ // DefaultRequestTTL serves as a fallback timeout for requests that do not specify their own
268+ // deadline.
269+ // It ensures that requests do not hang indefinitely in the queue.
270+ // If 0 or omitted, it defaults to the client context deadline, meaning requests may wait
271+ // indefinitely unless cancelled by the client.
272+ DefaultRequestTTL * metav1.Duration `json:"defaultRequestTTL,omitempty"`
273+
274+ // +optional
275+ // DefaultPriorityBand allows you to define a template for handling traffic with priority levels
276+ // that are not explicitly configured in `PriorityBands`.
277+ // This ensures that unforeseen traffic classes are still managed (e.g., given a default capacity
278+ // limit) rather than being rejected or treated arbitrarily.
279+ // If not specified, a system-default template is used to dynamically provision bands for new
280+ // priority levels. This template cascades to the standard `PriorityBandConfig` defaults.
281+ DefaultPriorityBand * PriorityBandConfig `json:"defaultPriorityBand,omitempty"`
282+
283+ // PriorityBands allows you to explicitly define policies (like capacity limits) for specific
284+ // priority levels. Traffic matching these priorities will be handled according to these rules.
285+ // If a priority band is not specified, it uses specific defaults.
286+ PriorityBands []PriorityBandConfig `json:"priorityBands,omitempty"`
287+ }
288+
289+ func (fcc * FlowControlConfig ) String () string {
290+ return fmt .Sprintf ("{MaxBytes: %v, DefaultPriorityBand: %v, PriorityBands: %v}" ,
291+ fcc .MaxBytes , fcc .DefaultPriorityBand , fcc .PriorityBands )
292+ }
293+
294+ // PriorityBandConfig configures a single priority band.
295+ type PriorityBandConfig struct {
296+ // Priority is the integer priority level for this band.
297+ // Higher values indicate higher priority.
298+ Priority int `json:"priority"`
299+
300+ // +optional
301+ // MaxBytes is the maximum number of bytes allowed for this priority band.
302+ // If 0 or omitted, the system default is used.
303+ // Default: 1 GB.
304+ MaxBytes * int64 `json:"maxBytes,omitempty"`
305+
306+ // +optional
307+ // FairnessPolicyRef specifies the name of the policy that governs flow selection.
308+ // If omitted, the system default ("global-strict-fairness-policy") is used.
309+ FairnessPolicyRef string `json:"fairnessPolicyRef,omitempty"`
310+
311+ // +optional
312+ // OrderingPolicyRef specifies the name of the policy that governs request selection within a flow.
313+ // If omitted, the system default ("fcfs-ordering-policy") is used.
314+ OrderingPolicyRef string `json:"orderingPolicyRef,omitempty"`
315+ }
316+
317+ func (pbc PriorityBandConfig ) String () string {
318+ return fmt .Sprintf ("{Priority: %d, MaxBytes: %v, FairnessPolicyRef: %s, OrderingPolicyRef: %s}" ,
319+ pbc .Priority , pbc .MaxBytes , pbc .FairnessPolicyRef , pbc .OrderingPolicyRef )
320+ }
0 commit comments