Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for traffic segments. #495

Merged
merged 61 commits into from
Dec 14, 2023
Merged

Add support for traffic segments. #495

merged 61 commits into from
Dec 14, 2023

Conversation

gargravarr
Copy link
Contributor

@gargravarr gargravarr commented Jun 7, 2023

This Pull Request (PR) adds support for traffic management through the use of
Skipper's TrafficSegment predicate. By default this feature is not active for
StackSets, and can be activated/controlled in the following way:

  • If a new StackSet includes the annotation "stackset-controller.zalando.org/use-traffic-segments": "true", the controller will manage ingress/routegroup and traffic with a dedicated resource per stack (a Ingress/RouteGroup segment), using TrafficSegment to split traffic. This annotation is only active when you start the controller with both --enable-traffic-segments and --annotated-traffic-segments set.
  • If someone (or some entity) updates an existing StackSet with the annotation
    "stackset-controller.zalando.org/use-traffic-segments": "true", the controller
    will convert the StackSet to use TrafficSegment in the following way:
    1. Creates Ingress/RouteGroup segments for each Stack, with the segment
      corresponding to each Stack traffic weight.
    2. Deletes the central Ingress/RouteGroup, only after the controller created
      per Stack segments.
  • Starting the controller with the option --enable-traffic-segments enables by default traffic segments on all StackSets. In this mode the controller will also convert StackSets using a central ingress resource as described above.
  • Starting the controller with the option --enable-traffic-segments and --annotated-traffic-segments enables traffic segments only on StzasckSets with the annotation "stackset-controller.zalando.org/use-traffic-segments": "true".

On StackSets with traffic segments, the controller switches traffic one segment
at a time, prioritizing first stacks with a higher increase in traffic share.

This PR also updates end 2 end tests to repeat the same tests also with StackSets with explicit support for Traffic Segments.

Finally, this PR removes deprecated varcheck and deadcode linters,
already covered by unused.

Signed-off-by: Rodrigo Reis <[email protected]>
@gargravarr gargravarr changed the title Debug e2es. WIP - Versioned Ingress Jun 9, 2023
Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
…uteGroup to Ingress (and vice-versa) E2Es

Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
Signed-off-by: Rodrigo Reis <[email protected]>
controller/stackset.go Outdated Show resolved Hide resolved
pkg/core/traffic.go Outdated Show resolved Hide resolved
controller/stackset.go Outdated Show resolved Hide resolved
pkg/core/traffic.go Outdated Show resolved Hide resolved
controller/stackset.go Outdated Show resolved Hide resolved
controller/stackset.go Outdated Show resolved Hide resolved
controller/stackset.go Outdated Show resolved Hide resolved
@mikkeloscar
Copy link
Contributor

👍

1 similar comment
@gargravarr
Copy link
Contributor Author

👍

@gargravarr gargravarr merged commit 4278725 into master Dec 14, 2023
7 checks passed
@gargravarr gargravarr deleted the ingress-version branch December 14, 2023 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants