You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Yilialinn (via GitHub)" <gi...@apache.org> on 2026/04/07 09:55:57 UTC

[PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Yilialinn opened a new pull request, #13173:
URL: https://github.com/apache/apisix/pull/13173

   ## Summary
   
   - Fix incorrect attribute types for `rules.weighted_upstreams.upstream.type`, `rules.weighted_upstreams.upstream.hash_on`, and `rules.weighted_upstreams.upstream.pass_host` from `array` to `string` in both EN and ZH docs.
   - Add `ewma` and `least_conn` as valid values for `rules.weighted_upstreams.upstream.type`, aligning with the upstream schema that supports all four load balancing algorithms (`roundrobin`, `chash`, `ewma`, `least_conn`).
   - Replace `${ADMIN_API_KEY}` with `${admin_key}` in all example code blocks for consistency with APISIX conventions.
   
   Ref: https://github.com/api7/docs/issues/892


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "Yilialinn (via GitHub)" <gi...@apache.org>.
Yilialinn merged PR #13173:
URL: https://github.com/apache/apisix/pull/13173


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3098928304


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -125,6 +139,213 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+```yaml title="adc.yaml"
+services:
+  - name: traffic-split-service
+    routes:
+      - uris:
+          - /headers
+        name: traffic-split-route
+        plugins:
+          traffic-split:
+            rules:
+              - weighted_upstreams:
+                  - upstream:
+                      type: roundrobin
+                      scheme: https
+                      pass_host: node
+                      nodes:
+                        - host: httpbin.org
+                          port: 443
+                          weight: 1
+                    weight: 3
+                  - weight: 2
+    upstream:
+      type: roundrobin
+      scheme: https
+      pass_host: node
+      nodes:
+        - host: mock.api7.ai
+          port: 443
+          weight: 1
+```
+
+同步配置到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+:::caution[known issue]
+
+Gateway API currently has a bug where the upstream scheme is not correctly configured. As a result, requests are forwarded over HTTP instead of HTTPS, which leads to the error `The plain HTTP request was sent to HTTPS port`.
+
+This issue is scheduled to be fixed in APISIX Ingress Controller version 2.0.2 and will also be addressed in API7 Ingress Controller in an upcoming release. Until then, this example cannot be completed using Gateway API. The manifest below is provided for reference only.

Review Comment:
   This Chinese doc section contains an English admonition title and English explanation text ("known issue" / "Gateway API currently has a bug..."). For consistency with the rest of the ZH documentation, please translate this admonition (including the title) to Chinese (or otherwise localize it consistently).
   ```suggestion
   :::caution[已知问题]
   
   Gateway API 当前存在一个缺陷,导致上游协议未被正确配置。因此,请求会通过 HTTP 而不是 HTTPS 转发,从而触发错误 `The plain HTTP request was sent to HTTPS port`。
   
   该问题计划在 APISIX Ingress Controller 2.0.2 版本中修复,并将在后续版本的 API7 Ingress Controller 中一并解决。在此之前,无法使用 Gateway API 完成本示例。下方清单内容仅供参考。
   ```



##########
docs/en/latest/plugins/traffic-split.md:
##########
@@ -80,13 +83,24 @@ admin_key=$(yq '.deployment.admin.admin_key[0].key' conf/config.yaml | sed 's/"/
 
 The following example demonstrates how to implement canary release with this Plugin.
 
-A Canary release is a gradual deployment in which an increasing percentage of traffic is directed to a new release, allowing for a controlled and monitored rollout. This method ensures that any potential issues or bugs in the new release can be identified and addressed early on, before fully redirecting all traffic.
+A canary release is a gradual deployment in which an increasing percentage of traffic is directed to a new release, allowing for a controlled and monitored rollout. This method ensures that any potential issues or bugs in the new release can be identified and addressed early on, before fully redirecting all traffic.
 
 Create a Route and configure `traffic-split` Plugin with the following rules:
 
+<Tabs
+groupId="api"
+defaultValue="admin-api"
+values={[
+{label: 'Admin API', value: 'admin-api'},
+{label: 'ADC', value: 'adc'},
+{label: 'Ingress Controller', value: 'aic'}
+]}>
+
+<TabItem value="admin-api">
+
 ```shell
 curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
-  -H "X-API-KEY: ${ADMIN_API_KEY}" \
+  -H "X-API-KEY: ${admin_key}" \
   -d '{

Review Comment:
   The PR description says "Replace `${ADMIN_API_KEY}` with `${admin_key}` in all example code blocks", but there are still many `${ADMIN_API_KEY}` occurrences in other docs files (e.g. multiple plugin docs under docs/en/latest/plugins and docs/zh/latest/plugins). Please either narrow the PR description to the traffic-split docs, or update the remaining docs to match the stated goal.



##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -53,12 +56,12 @@ description: traffic-split 插件根据条件和/或权重将流量引导至各
 | rules.weighted_upstreams.upstream_id | 字符串/整数 | 否 | | | 配置的上游对象的 ID。 |
 | rules.weighted_upstreams.weight | 整数 | 否 | weight = 1 | | 每个上游的权重。 |
 | rules.weighted_upstreams.upstream | object | 否 | | | 上游配置。此处不支持某些上游配置选项。这些字段为 `service_name`、`discovery_type`、`checks`、`retries`、`retry_timeout`、`desc` 和 `labels`。作为解决方法,您可以创建一个上游对象并在 `upstream_id` 中配置它。|
-| rules.weighted_upstreams.upstream.type | array | 否 | roundrobin | [roundrobin, chash] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希。|
-| rules.weighted_upstreams.upstream.hash_on | array | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
+| rules.weighted_upstreams.upstream.type | string | 否 | roundrobin | [roundrobin, chash, ewma, least_conn] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希,`ewma` 用于指数加权移动平均,`least_conn` 用于最少连接。|
+| rules.weighted_upstreams.upstream.hash_on | string | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
 | rules.weighted_upstreams.upstream.key | string | 否 | | | 当 `t​​ype` 为 `chash` 时使用。当 `hash_on` 设置为 `header` 或 `cookie` 时,需要 `key`。当 `hash_on` 设置为 `consumer` 时,不需要 `key`,因为消费者名称将自动用作密钥。 |

Review Comment:
   `type` is misspelled as `t​​ype` (contains stray/zero-width characters) in the inline code, which makes it harder to search/copy and can render oddly. Please change it to `type` in both occurrences in this table row/description.
   ```suggestion
   | rules.weighted_upstreams.upstream.hash_on | string | 否 | vars | | 当 `type` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
   | rules.weighted_upstreams.upstream.key | string | 否 | | | 当 `type` 为 `chash` 时使用。当 `hash_on` 设置为 `header` 或 `cookie` 时,需要 `key`。当 `hash_on` 设置为 `consumer` 时,不需要 `key`,因为消费者名称将自动用作密钥。 |
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3098894673


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -125,6 +139,213 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+```yaml title="adc.yaml"
+services:
+  - name: traffic-split-service
+    routes:
+      - uris:
+          - /headers
+        name: traffic-split-route
+        plugins:
+          traffic-split:
+            rules:
+              - weighted_upstreams:
+                  - upstream:
+                      type: roundrobin
+                      scheme: https
+                      pass_host: node
+                      nodes:
+                        - host: httpbin.org
+                          port: 443
+                          weight: 1
+                    weight: 3
+                  - weight: 2
+    upstream:
+      type: roundrobin
+      scheme: https
+      pass_host: node
+      nodes:
+        - host: mock.api7.ai
+          port: 443
+          weight: 1
+```
+
+同步配置到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+:::caution[known issue]
+
+Gateway API currently has a bug where the upstream scheme is not correctly configured. As a result, requests are forwarded over HTTP instead of HTTPS, which leads to the error `The plain HTTP request was sent to HTTPS port`.
+
+This issue is scheduled to be fixed in APISIX Ingress Controller version 2.0.2 and will also be addressed in API7 Ingress Controller in an upcoming release. Until then, this example cannot be completed using Gateway API. The manifest below is provided for reference only.

Review Comment:
   English admonition in Chinese doc



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3099016477


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -198,6 +430,216 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+```yaml title="adc.yaml"
+services:
+  - name: traffic-split-service
+    routes:
+      - uris:
+          - /headers
+        name: traffic-split-route
+        plugins:
+          traffic-split:
+            rules:
+              - match:
+                  - vars:
+                      - ["http_release", "==", "new_release"]
+                weighted_upstreams:
+                  - upstream:
+                      type: roundrobin
+                      scheme: https
+                      pass_host: node
+                      nodes:
+                        - host: httpbin.org
+                          port: 443
+                          weight: 1
+    upstream:
+      type: roundrobin
+      scheme: https
+      pass_host: node
+      nodes:
+        - host: mock.api7.ai
+          port: 443
+          weight: 1
+```
+
+同步配置到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+:::caution[known issue]
+
+Gateway API currently has a bug where the upstream scheme is not correctly configured. As a result, requests are forwarded over HTTP instead of HTTPS, which leads to the error `The plain HTTP request was sent to HTTPS port`.
+
+This issue is scheduled to be fixed in APISIX Ingress Controller version 2.0.2 and will also be addressed in API7 Ingress Controller in an upcoming release. Until then, this example cannot be completed using Gateway API. The manifest below is provided for reference only.

Review Comment:
   ditto, check the entire file please



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "Yilialinn (via GitHub)" <gi...@apache.org>.
Yilialinn commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3098992685


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -53,12 +56,12 @@ description: traffic-split 插件根据条件和/或权重将流量引导至各
 | rules.weighted_upstreams.upstream_id | 字符串/整数 | 否 | | | 配置的上游对象的 ID。 |
 | rules.weighted_upstreams.weight | 整数 | 否 | weight = 1 | | 每个上游的权重。 |
 | rules.weighted_upstreams.upstream | object | 否 | | | 上游配置。此处不支持某些上游配置选项。这些字段为 `service_name`、`discovery_type`、`checks`、`retries`、`retry_timeout`、`desc` 和 `labels`。作为解决方法,您可以创建一个上游对象并在 `upstream_id` 中配置它。|
-| rules.weighted_upstreams.upstream.type | array | 否 | roundrobin | [roundrobin, chash] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希。|
-| rules.weighted_upstreams.upstream.hash_on | array | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
+| rules.weighted_upstreams.upstream.type | string | 否 | roundrobin | [roundrobin, chash, ewma, least_conn] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希,`ewma` 用于指数加权移动平均,`least_conn` 用于最少连接。|
+| rules.weighted_upstreams.upstream.hash_on | string | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
 | rules.weighted_upstreams.upstream.key | string | 否 | | | 当 `t​​ype` 为 `chash` 时使用。当 `hash_on` 设置为 `header` 或 `cookie` 时,需要 `key`。当 `hash_on` 设置为 `consumer` 时,不需要 `key`,因为消费者名称将自动用作密钥。 |

Review Comment:
   I can't tell what's the difference here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3099024020


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -53,12 +56,12 @@ description: traffic-split 插件根据条件和/或权重将流量引导至各
 | rules.weighted_upstreams.upstream_id | 字符串/整数 | 否 | | | 配置的上游对象的 ID。 |
 | rules.weighted_upstreams.weight | 整数 | 否 | weight = 1 | | 每个上游的权重。 |
 | rules.weighted_upstreams.upstream | object | 否 | | | 上游配置。此处不支持某些上游配置选项。这些字段为 `service_name`、`discovery_type`、`checks`、`retries`、`retry_timeout`、`desc` 和 `labels`。作为解决方法,您可以创建一个上游对象并在 `upstream_id` 中配置它。|
-| rules.weighted_upstreams.upstream.type | array | 否 | roundrobin | [roundrobin, chash] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希。|
-| rules.weighted_upstreams.upstream.hash_on | array | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
+| rules.weighted_upstreams.upstream.type | string | 否 | roundrobin | [roundrobin, chash, ewma, least_conn] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希,`ewma` 用于指数加权移动平均,`least_conn` 用于最少连接。|
+| rules.weighted_upstreams.upstream.hash_on | string | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
 | rules.weighted_upstreams.upstream.key | string | 否 | | | 当 `t​​ype` 为 `chash` 时使用。当 `hash_on` 设置为 `header` 或 `cookie` 时,需要 `key`。当 `hash_on` 设置为 `consumer` 时,不需要 `key`,因为消费者名称将自动用作密钥。 |

Review Comment:
   Invisible Unicode characters. You can apply this suggestion.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3056830262


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -53,12 +53,12 @@ description: traffic-split 插件根据条件和/或权重将流量引导至各
 | rules.weighted_upstreams.upstream_id | 字符串/整数 | 否 | | | 配置的上游对象的 ID。 |
 | rules.weighted_upstreams.weight | 整数 | 否 | weight = 1 | | 每个上游的权重。 |
 | rules.weighted_upstreams.upstream | object | 否 | | | 上游配置。此处不支持某些上游配置选项。这些字段为 `service_name`、`discovery_type`、`checks`、`retries`、`retry_timeout`、`desc` 和 `labels`。作为解决方法,您可以创建一个上游对象并在 `upstream_id` 中配置它。|
-| rules.weighted_upstreams.upstream.type | array | 否 | roundrobin | [roundrobin, chash] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希。|
-| rules.weighted_upstreams.upstream.hash_on | array | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
+| rules.weighted_upstreams.upstream.type | string | 否 | roundrobin | [roundrobin, chash, ewma, least_conn] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希,`ewma` 用于指数加权移动平均,`least_conn` 用于最少连接。|
+| rules.weighted_upstreams.upstream.hash_on | string | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
 | rules.weighted_upstreams.upstream.key | string | 否 | | | 当 `t​​ype` 为 `chash` 时使用。当 `hash_on` 设置为 `header` 或 `cookie` 时,需要 `key`。当 `hash_on` 设置为 `consumer` 时,不需要 `key`,因为消费者名称将自动用作密钥。 |

Review Comment:
   反引号中的 `t​​ype` 看起来包含了不可见字符(可能是零宽字符),会导致文档搜索/复制粘贴时不一致。建议统一更正为 `type`。另外同一句里重复出现了“NGINX 变量 / Nginx 变量”的表述,建议去重并统一大小写。
   ```suggestion
   | rules.weighted_upstreams.upstream.hash_on | string | 否 | vars | | 当 `type` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie 或 Consumer 进行哈希处理。 |
   | rules.weighted_upstreams.upstream.key | string | 否 | | | 当 `type` 为 `chash` 时使用。当 `hash_on` 设置为 `header` 或 `cookie` 时,需要 `key`。当 `hash_on` 设置为 `consumer` 时,不需要 `key`,因为消费者名称将自动用作密钥。 |
   ```



##########
docs/en/latest/plugins/traffic-split.md:
##########
@@ -53,12 +53,12 @@ The traffic ratio between Upstream services may be less accurate since round rob
 | rules.weighted_upstreams.upstream_id | string/integer | False    |            |                             | ID of the configured Upstream object.    |
 | rules.weighted_upstreams.weight      | integer        | False    | weight = 1 |                             | Weight for each upstream.  |
 | rules.weighted_upstreams.upstream    | object         | False    |            |                             | Configuration of the upstream. Certain configuration options Upstream are not supported here. These fields are `service_name`, `discovery_type`, `checks`, `retries`, `retry_timeout`, `desc`, and `labels`. As a workaround, you can create an Upstream object and configure it in `upstream_id`.    |
-| rules.weighted_upstreams.upstream.type                  | array           | False    | roundrobin | [roundrobin, chash]         | Algorithm for traffic splitting. `roundrobin` for weighted round robin and `chash` for consistent hashing.        |
-| rules.weighted_upstreams.upstream.hash_on               | array           | False    | vars       |                             | Used when `type` is `chash`. Support hashing on [NGINX  variables](https://nginx.org/en/docs/varindex.html), headers, cookie, Consumer, or a combination of [NGINX  variables](https://nginx.org/en/docs/varindex.html).         |
+| rules.weighted_upstreams.upstream.type                  | string          | False    | roundrobin | [roundrobin, chash, ewma, least_conn] | Algorithm for traffic splitting. `roundrobin` for weighted round robin, `chash` for consistent hashing, `ewma` for exponential weighted moving average, and `least_conn` for least connections.        |
+| rules.weighted_upstreams.upstream.hash_on               | string          | False    | vars       |                             | Used when `type` is `chash`. Support hashing on [NGINX  variables](https://nginx.org/en/docs/varindex.html), headers, cookie, Consumer, or a combination of [NGINX  variables](https://nginx.org/en/docs/varindex.html).         |

Review Comment:
   The link text contains a double space in `NGINX  variables` (twice). Consider reducing it to a single space (`NGINX variables`) to avoid inconsistent rendering and copy/paste artifacts.
   ```suggestion
   | rules.weighted_upstreams.upstream.hash_on               | string          | False    | vars       |                             | Used when `type` is `chash`. Support hashing on [NGINX variables](https://nginx.org/en/docs/varindex.html), headers, cookie, Consumer, or a combination of [NGINX variables](https://nginx.org/en/docs/varindex.html).         |
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "Yilialinn (via GitHub)" <gi...@apache.org>.
Yilialinn commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3099086038


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -198,6 +430,216 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+```yaml title="adc.yaml"
+services:
+  - name: traffic-split-service
+    routes:
+      - uris:
+          - /headers
+        name: traffic-split-route
+        plugins:
+          traffic-split:
+            rules:
+              - match:
+                  - vars:
+                      - ["http_release", "==", "new_release"]
+                weighted_upstreams:
+                  - upstream:
+                      type: roundrobin
+                      scheme: https
+                      pass_host: node
+                      nodes:
+                        - host: httpbin.org
+                          port: 443
+                          weight: 1
+    upstream:
+      type: roundrobin
+      scheme: https
+      pass_host: node
+      nodes:
+        - host: mock.api7.ai
+          port: 443
+          weight: 1
+```
+
+同步配置到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+:::caution[known issue]
+
+Gateway API currently has a bug where the upstream scheme is not correctly configured. As a result, requests are forwarded over HTTP instead of HTTPS, which leads to the error `The plain HTTP request was sent to HTTPS port`.
+
+This issue is scheduled to be fixed in APISIX Ingress Controller version 2.0.2 and will also be addressed in API7 Ingress Controller in an upcoming release. Until then, this example cannot be completed using Gateway API. The manifest below is provided for reference only.

Review Comment:
   done



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "Yilialinn (via GitHub)" <gi...@apache.org>.
Yilialinn commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3098992685


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -53,12 +56,12 @@ description: traffic-split 插件根据条件和/或权重将流量引导至各
 | rules.weighted_upstreams.upstream_id | 字符串/整数 | 否 | | | 配置的上游对象的 ID。 |
 | rules.weighted_upstreams.weight | 整数 | 否 | weight = 1 | | 每个上游的权重。 |
 | rules.weighted_upstreams.upstream | object | 否 | | | 上游配置。此处不支持某些上游配置选项。这些字段为 `service_name`、`discovery_type`、`checks`、`retries`、`retry_timeout`、`desc` 和 `labels`。作为解决方法,您可以创建一个上游对象并在 `upstream_id` 中配置它。|
-| rules.weighted_upstreams.upstream.type | array | 否 | roundrobin | [roundrobin, chash] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希。|
-| rules.weighted_upstreams.upstream.hash_on | array | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
+| rules.weighted_upstreams.upstream.type | string | 否 | roundrobin | [roundrobin, chash, ewma, least_conn] | 流量分割算法。`roundrobin` 用于加权循环,`chash` 用于一致性哈希,`ewma` 用于指数加权移动平均,`least_conn` 用于最少连接。|
+| rules.weighted_upstreams.upstream.hash_on | string | 否 | vars | | 当 `t​​ype` 为 `chash` 时使用。支持对 [NGINX 变量](https://nginx.org/en/docs/varindex.html)、headers、cookie、Consumer 或 [Nginx 变量](https://nginx.org/en/docs/varindex.html) 的组合进行哈希处理。 |
 | rules.weighted_upstreams.upstream.key | string | 否 | | | 当 `t​​ype` 为 `chash` 时使用。当 `hash_on` 设置为 `header` 或 `cookie` 时,需要 `key`。当 `hash_on` 设置为 `consumer` 时,不需要 `key`,因为消费者名称将自动用作密钥。 |

Review Comment:
   I can't tell what the difference is here



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] docs: update traffic-split plugin attribute types and valid values [apisix]

Posted by "kayx23 (via GitHub)" <gi...@apache.org>.
kayx23 commented on code in PR #13173:
URL: https://github.com/apache/apisix/pull/13173#discussion_r3099016477


##########
docs/zh/latest/plugins/traffic-split.md:
##########
@@ -198,6 +430,216 @@ curl "http://127.0.0.1:9180/apisix/admin/routes" -X PUT \
   }'
 ```
 
+</TabItem>
+
+<TabItem value="adc">
+
+```yaml title="adc.yaml"
+services:
+  - name: traffic-split-service
+    routes:
+      - uris:
+          - /headers
+        name: traffic-split-route
+        plugins:
+          traffic-split:
+            rules:
+              - match:
+                  - vars:
+                      - ["http_release", "==", "new_release"]
+                weighted_upstreams:
+                  - upstream:
+                      type: roundrobin
+                      scheme: https
+                      pass_host: node
+                      nodes:
+                        - host: httpbin.org
+                          port: 443
+                          weight: 1
+    upstream:
+      type: roundrobin
+      scheme: https
+      pass_host: node
+      nodes:
+        - host: mock.api7.ai
+          port: 443
+          weight: 1
+```
+
+同步配置到网关:
+
+```shell
+adc sync -f adc.yaml
+```
+
+</TabItem>
+
+<TabItem value="aic">
+
+<Tabs
+groupId="k8s-api"
+defaultValue="gateway-api"
+values={[
+{label: 'Gateway API', value: 'gateway-api'},
+{label: 'APISIX CRD', value: 'apisix-crd'}
+]}>
+
+<TabItem value="gateway-api">
+
+:::caution[known issue]
+
+Gateway API currently has a bug where the upstream scheme is not correctly configured. As a result, requests are forwarded over HTTP instead of HTTPS, which leads to the error `The plain HTTP request was sent to HTTPS port`.
+
+This issue is scheduled to be fixed in APISIX Ingress Controller version 2.0.2 and will also be addressed in API7 Ingress Controller in an upcoming release. Until then, this example cannot be completed using Gateway API. The manifest below is provided for reference only.

Review Comment:
   ditto



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org