You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "AlinsRan (via GitHub)" <gi...@apache.org> on 2023/03/02 08:50:49 UTC

[GitHub] [apisix] AlinsRan commented on a diff in pull request #8901: docs: add the description of config.yaml support environment variables

AlinsRan commented on code in PR #8901:
URL: https://github.com/apache/apisix/pull/8901#discussion_r1122768966


##########
docs/zh/latest/admin-api.md:
##########
@@ -65,6 +65,46 @@ deployment:
             port: 9180                  # Admin API 监听的 端口,必须使用与 node_listen 不同的端口。
 ```
 
+### 使用环境变量 {$using-environment-variables}
+
+要通过环境变量进行配置,可以使用 `${{VAR}}` 语法。例如:
+
+```yaml title="./conf/config.yaml"
+deployment:
+  admin:
+    admin_key:
+    - name: admin
+      key: ${{ADMIN_KEY}}
+      role: admin
+    allow_admin:
+    - 127.0.0.0/24
+    admin_listen:
+      ip: 0.0.0.0
+      port: 9180
+```
+
+然后在 `make init` 之前运行 `export ADMIN_KEY=$your_admin_key`.

Review Comment:
   Ping @juzhiyuan .



-- 
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