smi-spec icon indicating copy to clipboard operation
smi-spec copied to clipboard

Clarify traffic-split weighting semantics

Open olix0r opened this issue 5 years ago • 3 comments

Consider the following:

  • We have a blue and green 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:

  1. 10% of the traffic is sent to each pod; OR
  2. 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 avatar May 15 '19 03:05 olix0r

@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.

surajssd avatar May 17 '19 08:05 surajssd

Do you feel there's a way to make this more clear in the docs? Maybe with a diagram?

christian-posta avatar Jun 03 '19 16:06 christian-posta

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 :-)

surajssd avatar Jun 04 '19 04:06 surajssd