As we know , APISIX can configure and distribute traffic through powerful
routing strategies. With this capability, we can achieve grayscale
publishing.

After the route is determined, we can again control the traffic to the
specified upstream through a plug-in, but it needs to be customized. I
propose that the community implement a version of the gray plug-in that
provides the following functions:

1. Specify matching conditions (for example, kv pairs of http querystring,
header and other parameters)
2. When a certain matching condition is met, specify upstream;
3. Specify the condition matching priority;

Definition example:

```javascript
{
"grayscale":{
"rules": [
{
"condition": [
{
"use": "header", // enum: uri_args/header/path_reg/default
"key": "user_id",
"values": [
"U1",
"U2",
"U3"
],
"operator": "anyOf" // enum: oneOf/anyOf/prefix/regular/...
},
...
],
"upstream": {},// upstream or upstreamId
"priority": 10 // 0~100 The larger the value, the higher the priority
},
{
"condition": [
{
"use": "header", // enum: uri_args/header/path_reg/default
"key": "appkey",
"values": [
"dfaef-xfdafe-xj1kl3-1-jhilh1",
"dfaef-xfdafe-xj1kl3-2-jhilh1",
"dfaef-xfdafe-xj1kl3-3-jhilh1"
],
"operator": "anyOf" // enum: oneOf/anyOf/prefix/regular/...
},
...
],
"upstream": {},// upstream or upstreamId
"priority": 10 // 0~100 The larger the value, the higher the priority
}
...
]
}
}
```

Reply via email to