Traffic Distribution feature (kubernetes 1.33)
Expected Behavior
Traffic Distribution feature is in General Availability starting from k8s-1.33. Current implementation fully capable to act as intended.
Current Behavior
Existing Zone Hints ignored if no HintsAnnotation() is present.
Possible Solution
We can remove (deprecated and removed since k8s-1.33) HintsAnnotation() value verification in felix/bpf/proxy/topology.go::ShouldAppendTopologyAwareEndpoint():
// If hints annotation is not recognized or empty then ignore Topology Aware Hints.
if hintsAnnotation != "Auto" && hintsAnnotation != "auto" {
if hintsAnnotation != "" && hintsAnnotation != "Disabled" && hintsAnnotation != "disabled" {
log.Debugf("Skipping topology aware endpoint filtering since Service has unexpected value '%s' for key '%s'\n", hintsAnnotation, v1.DeprecatedAnnotationTopologyAwareHints)
}
return true
}
Do we actually care why EndpointSlice contain Zone Hint? Or who added it? It could be added by user manually.
There are few cases when ZoneHint could be added:
- topology-aware-routing annotation
- trafficDistribution service property
- user created EnpointSlice.
Proposed modification will handle any endpoint slice conditions (well, zone related only) not matter who added them.
PS
k8s.io/kubernetes/pkg/proxy::ServicePort.HintsAnnotation() is removed since 1.33, so it has to be revisited anyway.
@alexdev-wb Thank you for your suggestion. We need to investigate what could be affected by removing hints annotation check.
@skoryk-oleksandr Any updates on this?
we are considering if it can make 3.31 or soon after
@tomastigera Any updates on this?
@tomastigera @skoryk-oleksandr Version 3.31 has already been released. Is there any update regarding this issue?