14
14
- [ Story 2] ( #story-2 )
15
15
- [ Story 3] ( #story-3 )
16
16
- [ Story 4] ( #story-4 )
17
- - [ Story 5] ( #story-5 )
18
17
- [ Notes/Constraints/Caveats] ( #notesconstraintscaveats )
19
18
- [ Risks and Mitigations] ( #risks-and-mitigations )
20
19
- [ Design Details] ( #design-details )
21
20
- [ Standard Heuristic Implementation (kube-proxy dataplane)] ( #standard-heuristic-implementation-kube-proxy-dataplane )
22
- - [ <code >Default</code > and < code >Spread</ code > ] ( #default-and-spread )
23
- - [ <code >Zone </code >] ( #zone )
21
+ - [ <code >Default</code >] ( #default )
22
+ - [ <code >Close </code >] ( #close )
24
23
- [ Changes within kube-proxy] ( #changes-within-kube-proxy )
25
24
- [ Status Reporting] ( #status-reporting )
26
25
- [ Condition usage by other implementations] ( #condition-usage-by-other-implementations )
@@ -189,11 +188,6 @@ such a preference in future refinements.
189
188
hints and preferences that implementations can consider when making routing
190
189
decisions.
191
190
192
- * ** Mandatory and Uniform Implementation Support:** Kubernetes implementations
193
- are not required to support all standard heuristics (e.g., ` Zone ` , ` Spread ` ).
194
- Even when standard heuristics are supported, their precise behavior and
195
- interpretation might vary across implementations.
196
-
197
191
* ** Replacement of Traffic Policies:** The new field is complementary to
198
192
` internalTrafficPolicy ` and ` externalTrafficPolicy ` . It does not aim to
199
193
substitute their role in enforcing strict traffic locality.
@@ -211,33 +205,28 @@ while making routing decisions. It does not offer strict routing guarantees.
211
205
212
206
The field will support the following initial values:
213
207
214
- <<[ UNRESOLVED Name for field values is under discussion] >>
215
208
216
209
* ` Default ` : Indicates no specific routing preference. The user delegates the
217
210
routing decision to the implementation, allowing it to apply its best-effort
218
211
strategy.
219
- * ` Spread ` : Encourages an equal distribution of traffic across
220
- endpoints, potentially spanning multiple zones (or regions).
221
- * ` Zone ` : Encourages routing traffic to endpoints within the same zone as
222
- the client. If no endpoints are available within the zone, traffic should be
223
- routed to other zones.
224
-
225
- <<[ /UNRESOLVED] >>
212
+ * ` Close ` : Indicates a preference for routing traffic to endpoints that
213
+ are topologically proximate to the client. The interpretation of
214
+ "topologically proximate" may vary across implementations and could encompass
215
+ endpoints within the same node, rack, zone, or even region.
226
216
227
- Implementations are strongly encouraged to support the standard values. While
228
- some flexibility in interpretation is permitted, implementations should aim to
229
- align their behavior with the described intent of these preferences as closely
230
- as possible.
217
+ Implementations SHOULD support the standard values. While some flexibility in
218
+ interpretation is permitted, implementations should aim to align their behavior
219
+ with the described intent of these preferences as closely as possible.
231
220
232
221
Implementations may support additional routing heuristics using values of the
233
222
form ` <domain>/<heuristicName> ` . Heuristics without a domain prefix will be
234
223
reserved for potential future standardization.
235
224
236
225
NOTE: Implementations reserve the right to refine the behavior associated with
237
226
any heuristic, including standard heuristics. This means the behavior enabled
238
- by values such as ` Default ` or ` Zone ` might evolve over time, and some
227
+ by values such as ` Default ` or ` Close ` might evolve over time, and some
239
228
evolutions might interpret the heuristic goals slightly differently. For
240
- example, in the case of ` Zone ` , an implementation might initially route
229
+ example, in the case of ` Close ` , an implementation might initially route
241
230
traffic within the zone without considering endpoint overload, while a future
242
231
refinement could introduce feedback mechanisms to detect overload and route
243
232
traffic outside the zone when necessary, optimizing overall performance. The
@@ -257,10 +246,10 @@ NOTE: Implementations reserve the right to refine the behavior associated with
257
246
implementation evolves. It may load balance across zones or regions.
258
247
259
248
#### Story 2
260
- * ** Requirement:** I want my application to primarily receive traffic from
261
- endpoints within the same zone for performance or cost reasons. However,
262
- I want to avoid connection failures if no local endpoints are available.
263
- * ** Solution:** Set ` routingPreference: Zone `
249
+ * ** Requirement:** I want my application to primarily send traffic to endpoints
250
+ that are topologically close for performance or cost reasons. However, I want
251
+ to avoid connection failures if no sufficiently close endpoints are available.
252
+ * ** Solution:** Set ` routingPreference: Close `
264
253
* ** Effect:** The Kubernetes implementation will aim to prioritize routing
265
254
traffic to endpoints in the same zone as the client. If no endpoints are
266
255
available within the zone, traffic will be routed to other zones. It's
@@ -269,16 +258,6 @@ NOTE: Implementations reserve the right to refine the behavior associated with
269
258
resources within the zone if this becomes a concern.
270
259
271
260
#### Story 3
272
- * ** Requirement:** I prioritize application availability and want to minimize the
273
- risk of outages due to localized overload. I'm willing to accept potentially
274
- higher costs associated with cross-zone traffic distribution.
275
- * ** Solution:** Set ` routingPreference: Spread `
276
- * ** Effect:** The Kubernetes implementation will try to distribute traffic as
277
- equally as possible across endpoints, potentially spanning multiple zones or
278
- regions. This can improve resilience but might lead to increased network
279
- traffic costs.
280
-
281
- #### Story 4
282
261
* ** Requirement:** As a developer of a widely deployed cluster-addon, I want to
283
262
be able to provide users an easy way to configure my Helm chart and/or
284
263
deployment configuration to enable same-zone routing behavior in a portable
@@ -289,7 +268,7 @@ NOTE: Implementations reserve the right to refine the behavior associated with
289
268
implementation. This simplifies their deployment process and reduces the
290
269
complexity of managing cross-cluster applications.
291
270
292
- #### Story 5
271
+ #### Story 4
293
272
* ** Requirement:** I have some other precise preferences for how traffic should
294
273
be routed, and I know that my chosen implementation supports the desired
295
274
preference.
@@ -306,16 +285,17 @@ configuration. There's a non-zero chance that we may need to revisit this again.
306
285
307
286
### Risks and Mitigations
308
287
309
- * ** Risk:** Having a routing preference like ` Zone ` comes at the risk of
310
- endpoints in certain zones being overloaded if the originating traffic is
311
- skewed towards a particular zone .
288
+ * ** Risk:** Having a routing preference like ` Close ` comes at the risk of
289
+ endpoints in certain locality being overloaded if the originating traffic is
290
+ skewed towards a particular locality .
312
291
313
292
** Mitigation:**
314
- * Emphasize in the documentation that the ` Zone ` preference is
315
- designed for low-latency or monetory-cost reasons, with the understanding
316
- that it can lead to overload within zones.
317
- * Recommend approaches like having deployments per zone which can scale
318
- independently of other zones.
293
+ * Emphasize in the documentation that the ` Close ` preference is designed for
294
+ low-latency or monetory-cost reasons, with the understanding that it can
295
+ lead to overload within that locality.
296
+ * Recommend approaches like having deployments per locality, (like a zone
297
+ locality when using kube-proxy as the data-plane), which can scale
298
+ independently of other localities.
319
299
320
300
* ** Risk:** Users migrating from the ` service.kubernetes.io/topology-mode `
321
301
annotation might encounter differences in exact routing behavior:
@@ -333,26 +313,30 @@ configuration. There's a non-zero chance that we may need to revisit this again.
333
313
### Standard Heuristic Implementation (kube-proxy dataplane)
334
314
335
315
kube-proxy (along with EndpointSlice controller, within kube-controller-manager
336
- as the control plane) will support the three standard routing preferences
337
- (` Default ` , ` Spread ` , ` Zone ` ).
316
+ as the control plane) will support the two standard routing preferences
317
+ (` Default ` , ` Close ` ).
338
318
339
- #### ` Default ` and ` Spread `
340
- * Initially, kube-proxy will treat the ` Default ` preference the same as
341
- ` Spread `
319
+ #### ` Default `
320
+ * ** Meaning:** ` Default ` value for kube-proxy would match it's existing
321
+ behaviour of having an equal distribution of traffic across endpoints
322
+ (potentially spanning multiple zones or regions)
342
323
* This leverages existing implementation, requiring no major changes.
343
324
344
- #### ` Zone `
325
+ #### ` Close `
326
+ * ** Meaning:** Attempts to route traffic to endpoints within the same zone as
327
+ the client. If no endpoints are available within the zone, traffic would be
328
+ routed to other zones.
345
329
* This preference will be implemented by the use of Hints within EndpointSlices.
346
330
* We already use Hints to implement ` service.kubernetes.io/topology-mode: Auto `
347
331
In a similar manner, the EndpointSlice controller will now also populate hints
348
- for ` routingPreference: Zone ` -- although in this case, the zone hint will
332
+ for ` routingPreference: Close ` -- although in this case, the zone hint will
349
333
match the endpoint of the zone itself.
350
334
* While it may seem redundant to populate the hints here since kube-proxy can
351
335
already derive the zone hint from the endpoints zone (as they would be the
352
336
same), we will still use this for implementation simply because of the reason
353
337
that it’s easier to implement and provides a better design. Consider an
354
338
alternative implementation where kube-proxy reads
355
- ` routingPreference: Zone ` field and then constructs the route rules
339
+ ` routingPreference: Close ` field and then constructs the route rules
356
340
accordingly. This means some extra logic needs to be baked into the kube-proxy
357
341
which could have just as easily been implemented by an already existing
358
342
extensibility mechanism (i.e. EndpointSlice hints)
@@ -531,14 +515,14 @@ The following packages will also see minor changes:
531
515
##### Integration tests
532
516
533
517
* Verify that if both the annotation ` service.kubernetes.io/topology-mode: Auto `
534
- and field ` routingPreference: Zone ` are configured, precedence is given to the
535
- annotation.
518
+ and field ` routingPreference: Close ` are configured, precedence is given to
519
+ the annotation.
536
520
537
521
##### e2e tests
538
522
539
523
* Verify that EndpointSlice hints are correctly populated when
540
- ` routingPreference ` is set to ` Zone ` .
541
- * Verify through probes that for ` routingPreference: Zone ` , requests originating
524
+ ` routingPreference ` is set to ` Close ` .
525
+ * Verify through probes that for ` routingPreference: Close ` , requests originating
542
526
from a zone which has service pods get sent to a pod in the same zone. For
543
527
requests originating from zones with no service pods, requests should not get
544
528
blackholed and should rather be forwarded to any service pod from the cluster.
@@ -877,8 +861,8 @@ along the following lines:
877
861
### Reuse the fields internal/externalTrafficPolicy to offer these routing preferences
878
862
879
863
This has been a major topic of discussion in the past, with questions around
880
- which field would be appropriate to support a heuristic like ` Zone ` . If we were
881
- to in fact use this approach we would be faced with the dilemma of choosing
864
+ which field would be appropriate to support a heuristic like ` PreferZone ` . If we
865
+ were to in fact use this approach we would be faced with the dilemma of choosing
882
866
between two less-than-ideal options:
883
867
884
868
* Dilute purpose and sacrifice semantic expectation
@@ -893,14 +877,14 @@ between two less-than-ideal options:
893
877
node since the logs would then report an incorrect log source.”. Values like
894
878
"Local" mandate that traffic must remain within the Node boundary.
895
879
896
- * ** Problem:** Introducing routing preferences like ` Zone ` would dilute this
897
- clear semantic meaning and could create potential misinterpretations. Using
898
- a separate field dedicated to routing preferences avoids this confusion and
899
- maintains consistency.
880
+ * ** Problem:** Introducing routing preferences like ` PreferZone ` would dilute
881
+ this clear semantic meaning and could create potential misinterpretations.
882
+ Using a separate field dedicated to routing preferences avoids this
883
+ confusion and maintains consistency.
900
884
901
885
* Become inflexible or rigid
902
886
903
- * Alternatively, if we introduce ` Zone ` without diluting the meaning of
887
+ * Alternatively, if we introduce ` PreferZone ` without diluting the meaning of
904
888
the existing fields, we'd need to create extremely specific and inflexible
905
889
rules for how it works across all implementations.
906
890
@@ -930,8 +914,8 @@ like `routingPreference` might be a better option is:
930
914
the Gateway API.
931
915
932
916
* The ` routingPreference ` field elegantly balances control and abstraction.
933
- Users can influence behavior with high-level heuristics (` Zone ` , ` Spread ` )
934
- while implementations handle the underlying complexity. Heuristics can flag
917
+ Users can influence behavior with high-level heuristics (like ` Close ` ) while
918
+ implementations handle the underlying complexity. Heuristics can flag
935
919
potential issues and guide users towards safe configurations. Using
936
920
independent fields increases the risk of unintended consequences, as
937
921
interactions between seemingly unrelated settings can create unexpected and
@@ -988,7 +972,7 @@ Rather than having to choose between the two, Pod Topology Spread Constraints
988
972
and ` routingPreference ` can offer slightly better and resilient traffic
989
973
distribution when used in conjunction.
990
974
991
- * Users can set ` routingPreference ` to ` Zone ` to express the preference for
975
+ * Users can set ` routingPreference ` to ` Close ` to express the preference for
992
976
keeping traffic within the same zone as the client.
993
977
* Then, they can configure Pod Topology Spread Constraints to Ensure balanced
994
978
pod distribution across zones, maximizing the likelihood that the
0 commit comments