Current logic:

1. To enable only the L7 proxy
This is the default configuration

2. To enable both L7 & L4 proxy
enable apisix.stream_proxy

3. To enable only the L4 proxy
enable apisix.stream_proxy and set enable_admin = false // This is actually
not easy to understand


NOTICE: The above mode is the operation of APISIX in the traditional mode
(the default enable_admin is true).
If the user changes the mode of APISIX to control plane (at this time
enable_admin is false by default), the above three become:

1. To enable only the L7 proxy
This is the default configuration

2. To enable both L7 & L4 proxy
enable apisix.stream_proxy and set apisix.stream_proxy.only = false

3. To enable only the L4 proxy
enable apisix.stream_proxy and set apisix.stream_proxy.only = true

-----
New solution:
If we add a configuration and remove apisix.stream_proxy.only:
proxy_mode: http or stream or http&stream

This has nothing to do with enable_admin.

1. To enable only the L7 proxy
This is the default configuration

2. To enable both L7 & L4 proxy
set apisix.proxy_mode =  http&stream

3. To enable only the L4 proxy
set apisix.proxy_mode =  stream

What do you think?

Thanks,
Ming Wen, Apache APISIX PMC Chair
Twitter: _WenMing


Traky Deng <traky.d...@protonmail.com.invalid> 于2023年4月26日周三 16:59写道:

> Hi all,
>
> It has been noticed during a doc recomposition that the developer
> experience of working with L4 and L7 proxies enablement in APISIX
> conf/config.yaml file are somewhat subpar. The motivation of this
> discussion is to see if people want to improve the design on the
> engineering side for a better developer experience.
>
> Currently in APISIX conf/config.yaml:
>
> 1. To enable only the L7 proxy, one should
>
> - set apisix.enable_admin to true (default); and
> - not defineapisix.stream_proxy yaml block
>
> 2. To enable only the L4 stream proxy, one should
>
> - set apisix.enable_admin to false;
>
> - define apisix.stream_proxy yaml block; and
> - set apisix.stream_proxy.only to true
>
> ​ Relevant code:
> https://github.com/apache/apisix/blob/1434335041c6e054f7b6afb0401aea0a069b0ad7/apisix/cli/ops.lua#L272-L277
>
> 3. To enable both L4 & L7 proxies, one should
>
> - set apisix.enable_admin to true (default)
> - define apisix.stream_proxy yaml block
>
> It seems that the value of apisix.stream_proxy.only does not have any
> effect.
>
> The relevant doc is currently at
> https://apisix.apache.org/docs/apisix/stream-proxy/#how-to-enable-stream-proxy
>
> I am also making some improvements to this doc in this PR (work in
> progress, collaborations welcomed):
> https://github.com/apache/apisix/pull/9367
>
> Thanks,
> Traky Deng

Reply via email to