Skip to content

Commit

Permalink
优化 readme
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-smile committed Nov 27, 2023
1 parent 8827c24 commit a85d2b9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
21 changes: 12 additions & 9 deletions sdks/apigw-manager/docs/sync-apigateway-with-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/*"
Expand All @@ -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 模板文件,样例如下:
Expand Down Expand Up @@ -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 }}"
Expand Down
2 changes: 1 addition & 1 deletion sdks/apigw-manager/examples/chart/use-configmap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

主要步骤:
- 1. 修改 values.yaml 中的 `apigatewaySync.extraEnvVars`
- 1. 安装 chart,例如: `helm install bk-demo . -n blueking`
- 2. 安装 chart,例如: `helm install bk-demo . -n blueking`
Original file line number Diff line number Diff line change
Expand Up @@ -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`

0 comments on commit a85d2b9

Please sign in to comment.