From 31eef024451535bc0aa7274fb2fbb64f4523339a Mon Sep 17 00:00:00 2001 From: hanyajun <1581532052@qq.com> Date: Tue, 18 Jun 2024 16:25:10 +0800 Subject: [PATCH] doc: support stage backends (#172) --- sdks/apigw-manager/README.md | 42 +++++++++++++++---- .../files/support-files/resources.yaml | 1 + .../support-files/resources.yaml | 1 + 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/sdks/apigw-manager/README.md b/sdks/apigw-manager/README.md index 3ba57e6..248477e 100644 --- a/sdks/apigw-manager/README.md +++ b/sdks/apigw-manager/README.md @@ -118,15 +118,39 @@ stage: # vars: # key: "value" # 代理配置 - proxy_http: - timeout: 60 - # 负载均衡类型 + Hosts - upstreams: - loadbalance: "roundrobin" - hosts: - # 网关调用后端服务的默认域名或IP,不包含Path,比如:http://api.example.com - - host: "" - weight: 100 + # proxy_http 与 backends 二选一, 推荐使用 backends 方式配置 + # 网关版本 <= 1.13.3, 只支持一个后端服务, 默认是 default + # proxy_http: + # timeout: 60 + # # 负载均衡类型 + Hosts + # upstreams: + # loadbalance: "roundrobin" + # hosts: + # # 网关调用后端服务的默认域名或IP,不包含Path,比如:http://api.example.com + # - host: "" + # weight: 100 + + # 网关版本 1.13.3之后引入 backends 配置方式,支持多后端服务 + # 注意: 资源中引用的 backend 一定要配置, 否则会导入失败,不配置则会选择 default 后端服务 + # 如果 backends 没有配置 default 且 resource 未指定 backend 则会导致版本发布校验失败 + backends: + - name: "default" + config: + timeout: 60 + loadbalance: "roundrobin" + hosts: + # 网关调用后端服务的默认域名或IP,不包含Path,比如:http://api.example.com + - host: "" + weight: 100 + + - name: "service1" + config: + timeout: 60 + loadbalance: "roundrobin" + hosts: + - host: "" + weight: 100 + # 环境插件配置 # plugin_configs: # - type: bk-rate-limit diff --git a/sdks/apigw-manager/examples/chart/use-configmap/files/support-files/resources.yaml b/sdks/apigw-manager/examples/chart/use-configmap/files/support-files/resources.yaml index d855158..42bb2cf 100644 --- a/sdks/apigw-manager/examples/chart/use-configmap/files/support-files/resources.yaml +++ b/sdks/apigw-manager/examples/chart/use-configmap/files/support-files/resources.yaml @@ -20,6 +20,7 @@ paths: allowApplyPermission: false matchSubpath: false backend: + # name: default 支持设置 backend, 默认不配置为 default,和 stage 的 backends 配置的后端服务 name 一致 type: HTTP method: get path: /anything diff --git a/sdks/apigw-manager/examples/chart/use-custom-docker-image/my-apigw-manager/support-files/resources.yaml b/sdks/apigw-manager/examples/chart/use-custom-docker-image/my-apigw-manager/support-files/resources.yaml index 160cc97..5aeb90c 100644 --- a/sdks/apigw-manager/examples/chart/use-custom-docker-image/my-apigw-manager/support-files/resources.yaml +++ b/sdks/apigw-manager/examples/chart/use-custom-docker-image/my-apigw-manager/support-files/resources.yaml @@ -20,6 +20,7 @@ paths: allowApplyPermission: false matchSubpath: false backend: + # name: default 支持设置 backend, 默认不配置为 default,和 stage 的 backends 配置的后端服务 name 一致 type: HTTP method: get path: /anything