Skip to content
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
73b3138
api: add requestdistribution config
jukie May 22, 2025
12c2de1
Merge branch 'main' into api-locality-routing-config
jukie May 22, 2025
4658c0f
Adjustments
jukie May 22, 2025
36210d4
gen-check
jukie May 22, 2025
d0d1373
cel validation
jukie May 22, 2025
b5df7fa
Merge branch 'main' into api-locality-routing-config
jukie May 22, 2025
d2494c9
Merge branch 'main' into api-locality-routing-config
jukie May 23, 2025
771067d
Merge branch 'main' into api-locality-routing-config
jukie May 23, 2025
b011bfd
Merge branch 'main' into api-locality-routing-config
jukie May 23, 2025
c92ee26
Merge branch 'main' into api-locality-routing-config
jukie May 23, 2025
bea63f3
regen
jukie May 23, 2025
e66c0e1
Merge branch 'main' into api-locality-routing-config
jukie May 26, 2025
23077f3
Merge branch 'main' into api-locality-routing-config
jukie May 27, 2025
99ecbc4
Merge branch 'main' into api-locality-routing-config
jukie May 27, 2025
eaa0303
remove weighted locality config
jukie May 28, 2025
3efea14
Merge branch 'main' into api-locality-routing-config
jukie May 28, 2025
657f9b0
regen
jukie May 28, 2025
6865853
Merge branch 'main' into api-locality-routing-config
jukie May 28, 2025
daf1045
Merge branch 'main' into api-locality-routing-config
jukie May 28, 2025
e7d5ccc
Merge branch 'main' into api-locality-routing-config
jukie May 28, 2025
9777899
Merge branch 'main' into api-locality-routing-config
jukie May 31, 2025
d81d1a6
Merge branch 'main' into api-locality-routing-config
jukie May 31, 2025
c494040
Merge branch 'main' into api-locality-routing-config
jukie Jun 1, 2025
a41d91a
Merge branch 'main' into api-locality-routing-config
jukie Jun 1, 2025
2259c52
Merge branch 'main' into api-locality-routing-config
jukie Jun 3, 2025
1e8ad66
Merge branch 'main' into api-locality-routing-config
jukie Jun 3, 2025
230c7ab
Merge branch 'main' into api-locality-routing-config
jukie Jun 5, 2025
66116a2
Merge branch 'main' into api-locality-routing-config
jukie Jun 20, 2025
8bce345
Merge branch 'main' into api-locality-routing-config
jukie Jun 22, 2025
45ea6d2
Remove requestDistribution field
jukie Jun 23, 2025
69c9844
Merge branch 'main' into api-locality-routing-config
jukie Jun 23, 2025
47de9b2
Merge branch 'main' into api-locality-routing-config
jukie Jun 24, 2025
af59d2e
Merge branch 'main' into api-locality-routing-config
jukie Jun 25, 2025
a0acfb1
Merge branch 'main' into api-locality-routing-config
jukie Jun 26, 2025
ed66bf7
updates
jukie Jun 26, 2025
6490978
pr-feedback
jukie Jun 26, 2025
54b57f1
Adjust descriptions
jukie Jun 26, 2025
4d26526
Merge branch 'main' into api-locality-routing-config
jukie Jun 27, 2025
f716197
Merge branch 'main' into api-locality-routing-config
jukie Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions api/v1alpha1/loadbalancer_types.go
Comment thread
jukie marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
//
// +kubebuilder:validation:XValidation:rule="self.type == 'ConsistentHash' ? has(self.consistentHash) : !has(self.consistentHash)",message="If LoadBalancer type is consistentHash, consistentHash field needs to be set."
// +kubebuilder:validation:XValidation:rule="self.type in ['Random', 'ConsistentHash'] ? !has(self.slowStart) : true ",message="Currently SlowStart is only supported for RoundRobin and LeastRequest load balancers."
// +kubebuilder:validation:XValidation:rule="self.type == 'ConsistentHash' ? !has(self.zoneAware) : true ",message="Currently ZoneAware is only supported for LeastRequest, Random, and RoundRobin load balancers."
type LoadBalancer struct {
// Type decides the type of Load Balancer policy.
// Valid LoadBalancerType values are
Expand All @@ -34,6 +35,12 @@ type LoadBalancer struct {
//
// +optional
SlowStart *SlowStart `json:"slowStart,omitempty"`

// ZoneAware defines the configuration related to the distribution of requests between locality zones.
//
// +optional
// +notImplementedHide
ZoneAware *ZoneAware `json:"zoneAware,omitempty"`
}

// LoadBalancerType specifies the types of LoadBalancer.
Expand Down Expand Up @@ -135,3 +142,39 @@ type SlowStart struct {
Window *metav1.Duration `json:"window"`
// TODO: Add support for non-linear traffic increases based on user usage.
}

// ZoneAware defines the configuration related to the distribution of requests between locality zones.
type ZoneAware struct {
// PreferLocalZone configures zone-aware routing to prefer sending traffic to the local locality zone.
//
// +optional
// +notImplementedHide
PreferLocal *PreferLocalZone `json:"preferLocal,omitempty"`
}

// PreferLocalZone configures zone-aware routing to prefer sending traffic to the local locality zone.
type PreferLocalZone struct {
// ForceLocalZone defines override configuration for forcing all traffic to stay within the local zone instead of the default behavior
// which maintains equal distribution among upstream endpoints while sending as much traffic as possible locally.
//
// +optional
// +notImplementedHide
Force *ForceLocalZone `json:"force,omitempty"`

// MinEndpointsThreshold is the minimum number of total upstream endpoints across all zones required to enable zone-aware routing.
//
// +optional
// +notImplementedHide
MinEndpointsThreshold *uint64 `json:"minEndpointsCount,omitempty"`
Comment thread
jukie marked this conversation as resolved.
}

// ForceLocalZone defines override configuration for forcing all traffic to stay within the local zone instead of the default behavior
// which maintains equal distribution among upstream endpoints while sending as much traffic as possible locally.
type ForceLocalZone struct {
// MinEndpointsInZoneThreshold is the minimum number of upstream endpoints in the local zone required to honor the forceLocalZone
// override. This is useful for protecting zones with fewer endpoints.
//
// +optional
// +notImplementedHide
MinEndpointsInZoneThreshold *uint32 `json:"minEndpointsInZoneThreshold,omitempty"`
}
70 changes: 70 additions & 0 deletions api/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -691,6 +691,34 @@ spec:
- Random
- RoundRobin
type: string
zoneAware:
description: ZoneAware defines the configuration related to the
distribution of requests between locality zones.
properties:
preferLocal:
description: PreferLocalZone configures zone-aware routing
to prefer sending traffic to the local locality zone.
properties:
force:
description: |-
ForceLocalZone defines override configuration for forcing all traffic to stay within the local zone instead of the default behavior
which maintains equal distribution among upstream endpoints while sending as much traffic as possible locally.
properties:
minEndpointsInZoneThreshold:
description: |-
MinEndpointsInZoneThreshold is the minimum number of upstream endpoints in the local zone required to honor the forceLocalZone
override. This is useful for protecting zones with fewer endpoints.
format: int32
type: integer
type: object
minEndpointsCount:
description: MinEndpointsThreshold is the minimum number
of total upstream endpoints across all zones required
to enable zone-aware routing.
format: int64
type: integer
type: object
type: object
required:
- type
type: object
Expand All @@ -703,6 +731,10 @@ spec:
LeastRequest load balancers.
rule: 'self.type in [''Random'', ''ConsistentHash''] ? !has(self.slowStart)
: true '
- message: Currently ZoneAware is only supported for LeastRequest,
Random, and RoundRobin load balancers.
rule: 'self.type == ''ConsistentHash'' ? !has(self.zoneAware) :
true '
mergeType:
description: |-
MergeType determines how this configuration is merged with existing BackendTrafficPolicy
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,35 @@ spec:
- Random
- RoundRobin
type: string
zoneAware:
description: ZoneAware defines the configuration related
to the distribution of requests between locality zones.
properties:
preferLocal:
description: PreferLocalZone configures zone-aware
routing to prefer sending traffic to the local
locality zone.
properties:
force:
description: |-
ForceLocalZone defines override configuration for forcing all traffic to stay within the local zone instead of the default behavior
which maintains equal distribution among upstream endpoints while sending as much traffic as possible locally.
properties:
minEndpointsInZoneThreshold:
description: |-
MinEndpointsInZoneThreshold is the minimum number of upstream endpoints in the local zone required to honor the forceLocalZone
override. This is useful for protecting zones with fewer endpoints.
format: int32
type: integer
type: object
minEndpointsCount:
description: MinEndpointsThreshold is the minimum
number of total upstream endpoints across
all zones required to enable zone-aware routing.
format: int64
type: integer
type: object
type: object
required:
- type
type: object
Expand All @@ -781,6 +810,10 @@ spec:
and LeastRequest load balancers.
rule: 'self.type in [''Random'', ''ConsistentHash''] ?
!has(self.slowStart) : true '
- message: Currently ZoneAware is only supported for LeastRequest,
Random, and RoundRobin load balancers.
rule: 'self.type == ''ConsistentHash'' ? !has(self.zoneAware)
: true '
proxyProtocol:
description: ProxyProtocol enables the Proxy Protocol when
communicating with the backend.
Expand Down
Loading