smi-spec
smi-spec copied to clipboard
Clarify traffic-split weighting semantics
Consider the following:
- We have a
blue
andgreen
service and deployment. - The
blue
deployment has 1 replica. - The
green
deployment has 9 replicas. - There is a service,
target
, with a traffic split:
--
apiVersion: smi-spec.io/v1beta1
kind: TrafficSplit
metadata:
name: target-split
spec:
service: target
backends:
- service: blue
weight: 1000m
- service: green
weight: 1000m
The behavior can either be:
- 10% of the traffic is sent to each pod; OR
- 50% of the traffic is sent to the blue pod and 5.5% of the traffic sent to each green pod.
I believe that the spec intends the latter, but as far as i can tell, the handling of weights is not described explicitly.
@olix0r the spec means the second.
In the implementation for istio https://github.com/deislabs/smi-adapter-istio we are calculating each individual share to convert it into Istio's VirtualService.
So the second option:
50% of the traffic is sent to the blue pod and 5.5% of the traffic sent to each green pod.
Do you feel there's a way to make this more clear in the docs? Maybe with a diagram?
Yes sure, PRs are welcome if things don't seem to sound very informative or as they intend to please send a fix and we can merge it :-)