From a85d2b91f2096e585ad130a84ef27113f9edaf36 Mon Sep 17 00:00:00 2001 From: alex-smile <443677891@qq.com> Date: Mon, 27 Nov 2023 20:36:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../docs/sync-apigateway-with-docker.md | 21 +++++++++++-------- .../examples/chart/use-configmap/README.md | 2 +- .../chart/use-custom-docker-image/README.md | 2 +- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/sdks/apigw-manager/docs/sync-apigateway-with-docker.md b/sdks/apigw-manager/docs/sync-apigateway-with-docker.md index c0e23c0d..55cfdbef 100644 --- a/sdks/apigw-manager/docs/sync-apigateway-with-docker.md +++ b/sdks/apigw-manager/docs/sync-apigateway-with-docker.md @@ -102,6 +102,7 @@ functions.sh 中的 bash 函数: 步骤2:在 chart values.yaml 中添加配置 ```yaml apigatewaySync: + image: "hub.bktencent.com/blueking/apigw-manager:latest" configMapMounts: - name: "sync-apigw-base" filePath: "files/support-files/*" @@ -115,6 +116,15 @@ apigatewaySync: - name: "sync-apigw-apidocs-en" filePath: "files/support-files/apidocs/en/*" mountPath: "/data/apidocs/en/" + extraEnvVars: + - name: BK_APIGW_NAME + value: "bk-demo" + - name: BK_APP_CODE + value: "bk-demo" + - name: BK_APP_SECRET + value: "secret" + - name: BK_API_URL_TMPL + value: "http://bkapi.example.com/api/{api_name}" ``` 步骤2:在 chart templates 下创建 ConfigMap 模板文件,样例如下: @@ -145,18 +155,11 @@ spec: - bash args: - bin/sync-apigateway.sh - image: "hub.bktencent.com/blueking/apigw-manager:latest" + image: "{{ .Values.apigatewaySync.image }}" imagePullPolicy: "Always" name: sync-apigateway env: - - name: BK_APIGW_NAME - value: "bk-demo" - - name: BK_APP_CODE - value: "bk-demo" - - name: BK_APP_SECRET - value: "secret" - - name: BK_API_URL_TMPL - value: "http://bkapi.example.com/api/{api_name}" + {{- toYaml .Values.apigatewaySync.extraEnvVars | nindent 8 }} volumeMounts: {{- range $item := .Values.apigatewaySync.configMapMounts }} - mountPath: "{{ $item.mountPath }}" diff --git a/sdks/apigw-manager/examples/chart/use-configmap/README.md b/sdks/apigw-manager/examples/chart/use-configmap/README.md index 8ea6e744..c4a4df00 100644 --- a/sdks/apigw-manager/examples/chart/use-configmap/README.md +++ b/sdks/apigw-manager/examples/chart/use-configmap/README.md @@ -2,4 +2,4 @@ 主要步骤: - 1. 修改 values.yaml 中的 `apigatewaySync.extraEnvVars` -- 1. 安装 chart,例如: `helm install bk-demo . -n blueking` \ No newline at end of file +- 2. 安装 chart,例如: `helm install bk-demo . -n blueking` \ No newline at end of file diff --git a/sdks/apigw-manager/examples/chart/use-custom-docker-image/README.md b/sdks/apigw-manager/examples/chart/use-custom-docker-image/README.md index ef601159..f828a8b9 100644 --- a/sdks/apigw-manager/examples/chart/use-custom-docker-image/README.md +++ b/sdks/apigw-manager/examples/chart/use-custom-docker-image/README.md @@ -5,6 +5,6 @@ - bk-demo-chart: chart 样例,使用生成的自定义镜像同步网关 主要步骤: -- 1. 构建自定义镜像,例如:`docker build -f build/Dockerfile --tag bk-demo-apigw-manager:development .` +- 1. 构建自定义镜像,例如:`docker build -f build/Dockerfile --tag bk-demo-apigw-manager:development build` - 2. 修改 bk-demo-chart/values.yaml 中的 `apigatewaySync.image`, `apigatewaySync.extraEnvVars` - 3. 安装 chart,例如:`helm install bk-demo-custom-docker bk-demo-chart -f bk-demo-chart/values.yaml -n blueking` \ No newline at end of file