Skip to content

Commit e910c3d

Browse files
authored
Merge branch 'kubernetes-sigs:main' into more-tracing-spans
2 parents 39f2e04 + a347fb3 commit e910c3d

File tree

232 files changed

+7205
-4712
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+7205
-4712
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ fmt-verify:
134134
vet: ## Run go vet against code.
135135
go vet ./...
136136

137+
#If you are running in local and your helm dependency is outdated, you can run `make test MODE=local`
137138
.PHONY: test
138139
test: generate fmt vet envtest image-build verify-crds verify-helm-charts ## Run tests.
139140
CGO_ENABLED=1 KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e | grep -v /conformance) -race -coverprofile cover.out
@@ -180,9 +181,10 @@ verify: vet fmt-verify generate ci-lint api-lint verify-all
180181
verify-crds: kubectl-validate
181182
hack/verify-manifests.sh
182183

184+
#If you are running in local and your helm dependency is outdated, you can run `make verify-helm-charts MODE=local`
183185
.PHONY: verify-helm-charts
184186
verify-helm-charts: helm-install
185-
hack/verify-helm.sh
187+
hack/verify-helm.sh $(MODE)
186188

187189
# Run static analysis.
188190
.PHONY: verify-all

apix/config/v1alpha1/endpointpickerconfig_types.go

Lines changed: 76 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -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

5964
func (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

132138
func (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 {
245251
func (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+
}

apix/config/v1alpha1/zz_generated.deepcopy.go

Lines changed: 64 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)