Skip to content

Commit 7a18a06

Browse files
fixup! fixup! fixup! fixup! fixup! Add KEP 4444: Routing Preference for Services
1 parent 17f18ed commit 7a18a06

File tree

1 file changed

+37
-39
lines changed
  • keps/sig-network/4444-service-routing-preference

1 file changed

+37
-39
lines changed

keps/sig-network/4444-service-routing-preference/README.md

Lines changed: 37 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- [Story 3](#story-3)
1616
- [Story 4](#story-4)
1717
- [Story 5](#story-5)
18-
- [Notes/Constraints/Caveats (Optional)](#notesconstraintscaveats-optional)
18+
- [Notes/Constraints/Caveats](#notesconstraintscaveats)
1919
- [Risks and Mitigations](#risks-and-mitigations)
2020
- [Design Details](#design-details)
2121
- [Standard Heuristic Implementation (kube-proxy dataplane)](#standard-heuristic-implementation-kube-proxy-dataplane)
@@ -50,7 +50,6 @@
5050
- [Granular Routing Controls](#granular-routing-controls)
5151
- [Reuse Pod Topology Spread Constraints for Traffic Distribution](#reuse-pod-topology-spread-constraints-for-traffic-distribution)
5252
- [Complementary Use of Pod Topology Spread Constraints and routingPreference](#complementary-use-of-pod-topology-spread-constraints-and-routingpreference)
53-
- [Infrastructure Needed (Optional)](#infrastructure-needed-optional)
5453
<!-- /toc -->
5554

5655
## Release Signoff Checklist
@@ -132,7 +131,7 @@ Topology aware routing together with `internalTrafficPolicy` were meant to be
132131
the successors of `topologyKeys` and allow implementations to be more flexible.
133132

134133
* TopologyAwareRouting:
135-
* Responds the annotation service.kubernetes.io/topology-mode. When this
134+
* Responds the annotation `service.kubernetes.io/topology-mode`. When this
136135
annotation is set to Auto, an implementation specific heuristic is used to
137136
route the traffic.
138137
* **Goal:** The aim with Auto was to allow implementations to be as smart as
@@ -196,8 +195,8 @@ such a preference in future refinements.
196195
interpretation might vary across implementations.
197196

198197
* **Replacement of Traffic Policies:** The new field is complementary to
199-
InternalTrafficPolicy and ExternalTrafficPolicy. It does not aim to substitute
200-
their role in enforcing strict traffic locality.
198+
`internalTrafficPolicy` and `externalTrafficPolicy`. It does not aim to
199+
substitute their role in enforcing strict traffic locality.
201200

202201
* **Immediate Support for All Possible Heuristics:** The initial implementation
203202
focuses on a core set of heuristics. Addition of new heuristics (like
@@ -212,6 +211,8 @@ while making routing decisions. It does not offer strict routing guarantees.
212211

213212
The field will support the following initial values:
214213

214+
<<[UNRESOLVED Name for field values is under discussion]>>
215+
215216
* `Default`: Indicates no specific routing preference. The user delegates the
216217
routing decision to the implementation, allowing it to apply its best-effort
217218
strategy.
@@ -221,6 +222,8 @@ The field will support the following initial values:
221222
the client. If no endpoints are available within the zone, traffic should be
222223
routed to other zones.
223224

225+
<<[/UNRESOLVED]>>
226+
224227
Implementations are strongly encouraged to support the standard values. While
225228
some flexibility in interpretation is permitted, implementations should aim to
226229
align their behavior with the described intent of these preferences as closely
@@ -248,7 +251,7 @@ NOTE: Implementations reserve the right to refine the behavior associated with
248251
* **Requirement:** I don't have strong preferences for how my application
249252
traffic is routed. I prioritize simplicity and trust my Kubernetes
250253
implementation to optimize traffic distribution.
251-
* **Solution:** Set `routingPreference=Default` (or leave the field unset)
254+
* **Solution:** Set `routingPreference: Default` (or leave the field unset)
252255
* **Effect:** The Kubernetes implementation will apply its best-effort routing
253256
strategy based on its design. This strategy might change over time as the
254257
implementation evolves. It may load balance across zones or regions.
@@ -257,7 +260,7 @@ NOTE: Implementations reserve the right to refine the behavior associated with
257260
* **Requirement:** I want my application to primarily receive traffic from
258261
endpoints within the same zone for performance or cost reasons. However,
259262
I want to avoid connection failures if no local endpoints are available.
260-
* **Solution:** Set `routingPreference=Zone`
263+
* **Solution:** Set `routingPreference: Zone`
261264
* **Effect:** The Kubernetes implementation will aim to prioritize routing
262265
traffic to endpoints in the same zone as the client. If no endpoints are
263266
available within the zone, traffic will be routed to other zones. It's
@@ -269,7 +272,7 @@ NOTE: Implementations reserve the right to refine the behavior associated with
269272
* **Requirement:** I prioritize application availability and want to minimize the
270273
risk of outages due to localized overload. I'm willing to accept potentially
271274
higher costs associated with cross-zone traffic distribution.
272-
* **Solution:** Set `routingPreference=Spread`
275+
* **Solution:** Set `routingPreference: Spread`
273276
* **Effect:** The Kubernetes implementation will try to distribute traffic as
274277
equally as possible across endpoints, potentially spanning multiple zones or
275278
regions. This can improve resilience but might lead to increased network
@@ -290,13 +293,13 @@ NOTE: Implementations reserve the right to refine the behavior associated with
290293
* **Requirement:** I have some other precise preferences for how traffic should
291294
be routed, and I know that my chosen implementation supports the desired
292295
preference.
293-
* **Solution:** Set `routingPreference=<domain>/<heuristicName>` (where
296+
* **Solution:** Set `routingPreference: <domain>/<heuristicName>` (where
294297
`<domain>` and `<heuristicName>` are provided by your implementation).
295298
* **Effect:** The Kubernetes implementation will apply the specified routing
296299
heuristic. It's important to note that the precise behavior of
297300
implementation-specific heuristics might vary.
298301

299-
### Notes/Constraints/Caveats (Optional)
302+
### Notes/Constraints/Caveats
300303

301304
This proposal is our third attempt at an API revolving around such a
302305
configuration. There's a non-zero chance that we may need to revisit this again.
@@ -340,15 +343,16 @@ as the control plane) will support the three standard routing preferences
340343

341344
#### `Zone`
342345
* This preference will be implemented by the use of Hints within EndpointSlices.
343-
* We already use Hints to implement `service.kubernetes.io/topology-mode=Auto`
344-
Similarly, we’ll use the same Hints within the EndpointSlice to implement the
345-
`Zone` heuristic – the hints will match the zone of the endpoint itself.
346+
* We already use Hints to implement `service.kubernetes.io/topology-mode: Auto`
347+
In a similar manner, the EndpointSlice controller will now also populate hints
348+
for `routingPreference: Zone` -- although in this case, the zone hint will
349+
match the endpoint of the zone itself.
346350
* While it may seem redundant to populate the hints here since kube-proxy can
347351
already derive the zone hint from the endpoints zone (as they would be the
348352
same), we will still use this for implementation simply because of the reason
349353
that it’s easier to implement and provides a better design. Consider an
350354
alternative implementation where kube-proxy reads
351-
`routingPreference=Zone` field and then constructs the route rules
355+
`routingPreference: Zone` field and then constructs the route rules
352356
accordingly. This means some extra logic needs to be baked into the kube-proxy
353357
which could have just as easily been implemented by an already existing
354358
extensibility mechanism (i.e. EndpointSlice hints)
@@ -417,8 +421,8 @@ currently provide a condition denoting acknowledgment from the dataplane. In the
417421
future when this is possible, another condition like the following could be
418422
used:
419423

420-
* RoutingPreferenceReady
421-
* **Type:** `RoutingPreferenceReady`
424+
* RoutingPreferenceHonored
425+
* **Type:** `RoutingPreferenceHonored`
422426
* **Description:** Confirms that the dataplane has received the hints,
423427
acknowledged them, and configured itself accordingly.
424428

@@ -480,22 +484,22 @@ captures the precedence
480484
<td>-</td>
481485
<td>-</td>
482486
<td>Auto</td>
483-
<td>routingPreference=Auto</td>
484-
<td>routingPreference=Auto</td>
487+
<td>routingPreference: Auto</td>
488+
<td>routingPreference: Auto</td>
485489
</tr>
486490
<tr>
487491
<td>Local</td>
488492
<td>-</td>
489493
<td>Auto</td>
490-
<td>ExternalTrafficPolicy=Local</td>
491-
<td>routingPreference=Auto</td>
494+
<td>ExternalTrafficPolicy: Local</td>
495+
<td>routingPreference: Auto</td>
492496
</tr>
493497
<tr>
494498
<td>Local</td>
495499
<td>Local</td>
496500
<td>Auto</td>
497-
<td>ExternalTrafficPolicy=Local</td>
498-
<td>InternalTrafficPolicy=Local</td>
501+
<td>ExternalTrafficPolicy: Local</td>
502+
<td>InternalTrafficPolicy: Local</td>
499503
</tr>
500504
</tbody>
501505
</table>
@@ -526,25 +530,24 @@ The following packages will also see minor changes:
526530

527531
##### Integration tests
528532

529-
* Verify that if both the annotation `service.kubernetes.io/topology-mode=Auto`
530-
and field `routingPreference=Zone` are configured, precedence is given
531-
to the annotation.
533+
* 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.
532536

533537
##### e2e tests
534538

535539
* Verify that EndpointSlice hints are correctly populated when
536-
`routingPreference=Zone`
537-
* Verify through probes that when `routingPreference=Zone`, requests
538-
originating from a zone which has service pods get sent to a pod in the same
539-
zone. For requests originating from zones with no service pods, requests
540-
should not get blackholed and should rather be forwarded to any service pod
541-
from the cluster.
540+
`routingPreference` is set to `Zone`.
541+
* Verify through probes that for `routingPreference: Zone`, requests originating
542+
from a zone which has service pods get sent to a pod in the same zone. For
543+
requests originating from zones with no service pods, requests should not get
544+
blackholed and should rather be forwarded to any service pod from the cluster.
542545

543546
### Graduation Criteria
544547

545548
#### Alpha
546549

547-
- Feature implemented behind a feature flag
550+
- Feature implemented behind a feature gate
548551
- Initial e2e tests completed and enabled
549552

550553
### Upgrade / Downgrade Strategy
@@ -570,11 +573,11 @@ Version skews should naturally get handled as per the following behaviour.
570573

571574
* **kube-apiserver:** [Kubernetes Version Skew
572575
Policies](https://kubernetes.io/releases/version-skew-policy/#supported-version-skew)
573-
require that kube-apiserver is atleast at the version of kube-proxy or
576+
require that kube-apiserver is at least at the version of kube-proxy or
574577
kube-controller-manager. The only valid version skew would mean that a newer
575578
kube-apiserver serves the new `routingPreference` field but the older
576579
kube-proxy and kube-controller-manager would silently ignore this field. (No
577-
adverse affect, behaviour equivalent to feature being disabled)
580+
adverse affect, behaviour equivalent to feature being disabled).
578581

579582
* **New kube-controller-manager (EndpointSlice controller) / Old kube-proxy:**
580583

@@ -991,8 +994,3 @@ distribution when used in conjunction.
991994
pod distribution across zones, maximizing the likelihood that the
992995
`routingPreference` can be satisfied and reduce (although not completely
993996
eliminate) chances of overload for a single zone.
994-
995-
996-
## Infrastructure Needed (Optional)
997-
998-
N/A

0 commit comments

Comments
 (0)