Skip to content

Conversation

@pleshakov
Copy link
Contributor

@pleshakov pleshakov commented Oct 30, 2019

Proposed changes

This PR improves the routing rules in VirtualServer and
VirtualServerRoute:

Introduce actions: implement actions of the type pass.

Before:

  routes:
  - path: /tea
    upstream: tea

Now:

  - path: /tea
    action:
      pass: tea

Get rid of rules field. Instead, add matches field and Improve conditions - allow conditions to include matched values.

Before:

path: /coffee
rules:
  conditions:
  - cookie: user
  matches:
  - values:
    - john
    upstream: coffee-future
  - values:
    - bob
    upstream: coffee-deprecated
  defaultUpstream: coffee-stable

Now:

path: /coffee
matches:
- conditions:
  - cookie: user
    value: john
  action:
    pass: coffee-future
- conditions:
  - cookie: user
    value: bob
  action:
    pass: coffee-deprecated
action:
  pass: coffee-stable

Improve matches - allow splits in matches.

path: /tea
matches:
- conditions:
  - cookie: user
    value: pro
  splits:
  - weight: 90
    action:
      pass: tea-v1
  - weight: 10
    action:
      pass: tea-v2
action:
  pass: tea-v1

The improvements are not backward compatible.

This commit improves the routing rules in VirtualServer and
VirtualServerRoute:
- Introduce actions: implement actions of the type pass.
- Get rid of rules field. Instead, add matches field.
- Improve conditions - allow conditions to include matched values.
- Improve matches - allow splits in matches.

The improvements are not backward compatible.
@pleshakov pleshakov added enhancement Pull requests for new features/feature enhancements change Pull requests that introduce a change labels Oct 30, 2019
Add tests for VSR split traffic and advanced routing.
Add tests for focused canary deployment.
@pleshakov pleshakov merged commit d0a285c into master Oct 31, 2019
@pleshakov pleshakov deleted the improve-routing-rules branch October 31, 2019 17:50
@pleshakov pleshakov changed the title Improve routing rules Improve routing rules in VS/VSR Dec 17, 2019
@damienlog
Copy link

Proposed changes

This PR improves the routing rules in VirtualServer and
VirtualServerRoute:

Introduce actions: implement actions of the type pass.

Before:

  routes:
  - path: /tea
    upstream: tea

Now:

  - path: /tea
    action:
      pass: tea

Get rid of rules field. Instead, add matches field and Improve conditions - allow conditions to include matched values.

Before:

path: /coffee
rules:
  conditions:
  - cookie: user
  matches:
  - values:
    - john
    upstream: coffee-future
  - values:
    - bob
    upstream: coffee-deprecated
  defaultUpstream: coffee-stable

Now:

path: /coffee
matches:
- conditions:
  - cookie: user
    value: john
  action:
    pass: coffee-future
- conditions:
  - cookie: user
    value: bob
  action:
    pass: coffee-deprecated
action:
  pass: coffee-stable

Improve matches - allow splits in matches.

path: /tea
matches:
- conditions:
  - cookie: user
    value: pro
  splits:
  - weight: 90
    action:
      pass: tea-v1
  - weight: 10
    action:
      pass: tea-v2
action:
  pass: tea-v1

The improvements are not backward compatible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change Pull requests that introduce a change enhancement Pull requests for new features/feature enhancements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants