You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by wei jin <kv...@apache.org> on 2020/09/12 08:51:33 UTC
[DISCUSS] Provide a community version implementation of a grayscale
plug-in for APISIX
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
}
...
]
}
}
```
Re: [DISCUSS] Provide a community version implementation of a
grayscale plug-in for APISIX
Posted by junxu chen <ch...@apache.org>.
Nice feature that would be convenient for users.
On Mon, Sep 14, 2020 at 11:16 AM wei jin <kv...@apache.org> wrote:
> yes, APISIX implement all feature in route object now, I think it is also
> useful to implement in a plugin , and they can be combined to use together.
>
> Ming Wen <we...@apache.org> 于2020年9月14日周一 上午9:17写道:
>
> > Hi, wei jin,
> > Do you mean to implement routing matching and dynamically modifying
> > upstream in the plugin?
> > Both of them are implemented in the router object now.
> > So the canary release is now bound to the router. It would be better if
> > there is a separate plugin to implement it.
> >
> > Thanks,
> > Ming Wen, Apache APISIX & Apache SkyWalking
> > Twitter: _WenMing
> >
> >
> > wei jin <kv...@apache.org> 于2020年9月12日周六 下午4:51写道:
> >
> > > 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
> > > }
> > > ...
> > > ]
> > > }
> > > }
> > > ```
> > >
> >
>
Re: [DISCUSS] Provide a community version implementation of a
grayscale plug-in for APISIX
Posted by wei jin <kv...@apache.org>.
In fact, I prefer to choose different upstream through rules
vincixu <vi...@apache.org> 于2020年9月16日周三 下午4:09写道:
> Nice feature, but I think we should not implement it as a plugin, because
> it is not a real plugin, but just a routing function in a specific
> scenario.
> I think it should belong to Upstream, you can set additional rules for a
> single Node.
> In addition, I think the option "k8s_deployment_info" of upstream is not
> necessary, it limits the user's choice. Maybe we should propose a new
> concept `Endpoint` to replace `Node`, and then make `grayscale` as a
> conditional setting
>
> YuanSheng Wang <me...@apache.org> 于2020年9月14日周一 下午12:09写道:
>
> > nice feature, +1
> >
> > On Mon, Sep 14, 2020 at 11:54 AM Ming Wen <we...@apache.org> wrote:
> >
> > > cool, +1
> > >
> > > Thanks,
> > > Ming Wen, Apache APISIX & Apache SkyWalking
> > > Twitter: _WenMing
> > >
> > >
> > > wei jin <kv...@apache.org> 于2020年9月14日周一 上午11:16写道:
> > >
> > > > yes, APISIX implement all feature in route object now, I think it is
> > > also
> > > > useful to implement in a plugin , and they can be combined to use
> > > together.
> > > >
> > > > Ming Wen <we...@apache.org> 于2020年9月14日周一 上午9:17写道:
> > > >
> > > > > Hi, wei jin,
> > > > > Do you mean to implement routing matching and dynamically modifying
> > > > > upstream in the plugin?
> > > > > Both of them are implemented in the router object now.
> > > > > So the canary release is now bound to the router. It would be
> better
> > if
> > > > > there is a separate plugin to implement it.
> > > > >
> > > > > Thanks,
> > > > > Ming Wen, Apache APISIX & Apache SkyWalking
> > > > > Twitter: _WenMing
> > > > >
> > > > >
> > > > > wei jin <kv...@apache.org> 于2020年9月12日周六 下午4:51写道:
> > > > >
> > > > > > 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
> > > > > > }
> > > > > > ...
> > > > > > ]
> > > > > > }
> > > > > > }
> > > > > > ```
> > > > > >
> > > > >
> > > >
> > >
> >
> >
> > --
> >
> > *MembPhis*
> > My GitHub: https://github.com/membphis
> > Apache APISIX: https://github.com/apache/incubator-apisix
> >
>
Re: [DISCUSS] Provide a community version implementation of a
grayscale plug-in for APISIX
Posted by vincixu <vi...@apache.org>.
Nice feature, but I think we should not implement it as a plugin, because
it is not a real plugin, but just a routing function in a specific scenario.
I think it should belong to Upstream, you can set additional rules for a
single Node.
In addition, I think the option "k8s_deployment_info" of upstream is not
necessary, it limits the user's choice. Maybe we should propose a new
concept `Endpoint` to replace `Node`, and then make `grayscale` as a
conditional setting
YuanSheng Wang <me...@apache.org> 于2020年9月14日周一 下午12:09写道:
> nice feature, +1
>
> On Mon, Sep 14, 2020 at 11:54 AM Ming Wen <we...@apache.org> wrote:
>
> > cool, +1
> >
> > Thanks,
> > Ming Wen, Apache APISIX & Apache SkyWalking
> > Twitter: _WenMing
> >
> >
> > wei jin <kv...@apache.org> 于2020年9月14日周一 上午11:16写道:
> >
> > > yes, APISIX implement all feature in route object now, I think it is
> > also
> > > useful to implement in a plugin , and they can be combined to use
> > together.
> > >
> > > Ming Wen <we...@apache.org> 于2020年9月14日周一 上午9:17写道:
> > >
> > > > Hi, wei jin,
> > > > Do you mean to implement routing matching and dynamically modifying
> > > > upstream in the plugin?
> > > > Both of them are implemented in the router object now.
> > > > So the canary release is now bound to the router. It would be better
> if
> > > > there is a separate plugin to implement it.
> > > >
> > > > Thanks,
> > > > Ming Wen, Apache APISIX & Apache SkyWalking
> > > > Twitter: _WenMing
> > > >
> > > >
> > > > wei jin <kv...@apache.org> 于2020年9月12日周六 下午4:51写道:
> > > >
> > > > > 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
> > > > > }
> > > > > ...
> > > > > ]
> > > > > }
> > > > > }
> > > > > ```
> > > > >
> > > >
> > >
> >
>
>
> --
>
> *MembPhis*
> My GitHub: https://github.com/membphis
> Apache APISIX: https://github.com/apache/incubator-apisix
>
Re: [DISCUSS] Provide a community version implementation of a
grayscale plug-in for APISIX
Posted by YuanSheng Wang <me...@apache.org>.
nice feature, +1
On Mon, Sep 14, 2020 at 11:54 AM Ming Wen <we...@apache.org> wrote:
> cool, +1
>
> Thanks,
> Ming Wen, Apache APISIX & Apache SkyWalking
> Twitter: _WenMing
>
>
> wei jin <kv...@apache.org> 于2020年9月14日周一 上午11:16写道:
>
> > yes, APISIX implement all feature in route object now, I think it is
> also
> > useful to implement in a plugin , and they can be combined to use
> together.
> >
> > Ming Wen <we...@apache.org> 于2020年9月14日周一 上午9:17写道:
> >
> > > Hi, wei jin,
> > > Do you mean to implement routing matching and dynamically modifying
> > > upstream in the plugin?
> > > Both of them are implemented in the router object now.
> > > So the canary release is now bound to the router. It would be better if
> > > there is a separate plugin to implement it.
> > >
> > > Thanks,
> > > Ming Wen, Apache APISIX & Apache SkyWalking
> > > Twitter: _WenMing
> > >
> > >
> > > wei jin <kv...@apache.org> 于2020年9月12日周六 下午4:51写道:
> > >
> > > > 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
> > > > }
> > > > ...
> > > > ]
> > > > }
> > > > }
> > > > ```
> > > >
> > >
> >
>
--
*MembPhis*
My GitHub: https://github.com/membphis
Apache APISIX: https://github.com/apache/incubator-apisix
Re: [DISCUSS] Provide a community version implementation of a
grayscale plug-in for APISIX
Posted by Ming Wen <we...@apache.org>.
cool, +1
Thanks,
Ming Wen, Apache APISIX & Apache SkyWalking
Twitter: _WenMing
wei jin <kv...@apache.org> 于2020年9月14日周一 上午11:16写道:
> yes, APISIX implement all feature in route object now, I think it is also
> useful to implement in a plugin , and they can be combined to use together.
>
> Ming Wen <we...@apache.org> 于2020年9月14日周一 上午9:17写道:
>
> > Hi, wei jin,
> > Do you mean to implement routing matching and dynamically modifying
> > upstream in the plugin?
> > Both of them are implemented in the router object now.
> > So the canary release is now bound to the router. It would be better if
> > there is a separate plugin to implement it.
> >
> > Thanks,
> > Ming Wen, Apache APISIX & Apache SkyWalking
> > Twitter: _WenMing
> >
> >
> > wei jin <kv...@apache.org> 于2020年9月12日周六 下午4:51写道:
> >
> > > 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
> > > }
> > > ...
> > > ]
> > > }
> > > }
> > > ```
> > >
> >
>
Re: [DISCUSS] Provide a community version implementation of a
grayscale plug-in for APISIX
Posted by wei jin <kv...@apache.org>.
yes, APISIX implement all feature in route object now, I think it is also
useful to implement in a plugin , and they can be combined to use together.
Ming Wen <we...@apache.org> 于2020年9月14日周一 上午9:17写道:
> Hi, wei jin,
> Do you mean to implement routing matching and dynamically modifying
> upstream in the plugin?
> Both of them are implemented in the router object now.
> So the canary release is now bound to the router. It would be better if
> there is a separate plugin to implement it.
>
> Thanks,
> Ming Wen, Apache APISIX & Apache SkyWalking
> Twitter: _WenMing
>
>
> wei jin <kv...@apache.org> 于2020年9月12日周六 下午4:51写道:
>
> > 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
> > }
> > ...
> > ]
> > }
> > }
> > ```
> >
>
Re: [DISCUSS] Provide a community version implementation of a
grayscale plug-in for APISIX
Posted by Ming Wen <we...@apache.org>.
Hi, wei jin,
Do you mean to implement routing matching and dynamically modifying
upstream in the plugin?
Both of them are implemented in the router object now.
So the canary release is now bound to the router. It would be better if
there is a separate plugin to implement it.
Thanks,
Ming Wen, Apache APISIX & Apache SkyWalking
Twitter: _WenMing
wei jin <kv...@apache.org> 于2020年9月12日周六 下午4:51写道:
> 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
> }
> ...
> ]
> }
> }
> ```
>