navendu-pottekkat commented on code in PR #8901:
URL: https://github.com/apache/apisix/pull/8901#discussion_r1112726168
##########
docs/en/latest/admin-api.md:
##########
@@ -63,6 +63,47 @@ deployment:
port: 9180 # Specific port, which must be
different from node_listen's port.
```
+### Support environment variables
Review Comment:
Maybe change this title to "Using environment variables"?
##########
docs/en/latest/admin-api.md:
##########
@@ -63,6 +63,47 @@ deployment:
port: 9180 # Specific port, which must be
different from node_listen's port.
```
+### Support environment variables
+
+To configure via environment variables, you can use `${{VAR}}` syntax. For
instance:
Review Comment:
```suggestion
To configure via environment variables, you can use the `${{VAR}}` syntax.
For instance:
```
##########
docs/en/latest/admin-api.md:
##########
@@ -63,6 +63,47 @@ deployment:
port: 9180 # Specific port, which must be
different from node_listen's port.
```
+### Support environment variables
+
+To configure via environment variables, you can use `${{VAR}}` syntax. For
instance:
+
+```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
+```
+
+ And then run `export ADMIN_KEY=$your_admin_key` before `make init`.
Review Comment:
```suggestion
And then run `export ADMIN_KEY=$your_admin_key` before running `make init`.
```
##########
docs/en/latest/admin-api.md:
##########
@@ -63,6 +63,47 @@ deployment:
port: 9180 # Specific port, which must be
different from node_listen's port.
```
+### Support environment variables
+
+To configure via environment variables, you can use `${{VAR}}` syntax. For
instance:
+
+```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
+```
+
+ And then run `export ADMIN_KEY=$your_admin_key` before `make init`.
+
+ If the configured environment variable can't be found, an error will be
thrown.
+
+ Also, If you want to use default value when the environment variable not set,
Review Comment:
```suggestion
If you want to use a default value when the environment variable is not set,
```
##########
docs/en/latest/admin-api.md:
##########
@@ -63,6 +63,47 @@ deployment:
port: 9180 # Specific port, which must be
different from node_listen's port.
```
+### Support environment variables
+
+To configure via environment variables, you can use `${{VAR}}` syntax. For
instance:
+
+```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
+```
+
+ And then run `export ADMIN_KEY=$your_admin_key` before `make init`.
+
+ If the configured environment variable can't be found, an error will be
thrown.
+
+ Also, If you want to use default value when the environment variable not set,
+ Use `${{VAR:=default_value}}` instead. For instance:
+
+```yaml title="./conf/config.yaml"
+deployment:
+ admin:
+ admin_key:
+ - name: admin
+ key: ${{ADMIN_KEY:=edd1c9f034335f136f87ad84b625c8f1}}
+ role: admin
+ allow_admin:
+ - 127.0.0.0/24
+ admin_listen:
+ ip: 0.0.0.0
+ port: 9180
+```
+
+This will find environment variable `ADMIN_KEY` first, and if it's not exist
it will use `edd1c9f034335f136f87ad84b625c8f1` as default value.
Review Comment:
```suggestion
This will find the environment variable `ADMIN_KEY` first, and if it does
not exist, it will use `edd1c9f034335f136f87ad84b625c8f1` as the default value.
```
##########
docs/en/latest/admin-api.md:
##########
@@ -63,6 +63,47 @@ deployment:
port: 9180 # Specific port, which must be
different from node_listen's port.
```
+### Support environment variables
+
+To configure via environment variables, you can use `${{VAR}}` syntax. For
instance:
+
+```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
+```
+
+ And then run `export ADMIN_KEY=$your_admin_key` before `make init`.
+
+ If the configured environment variable can't be found, an error will be
thrown.
+
+ Also, If you want to use default value when the environment variable not set,
+ Use `${{VAR:=default_value}}` instead. For instance:
Review Comment:
```suggestion
use `${{VAR:=default_value}}` instead. For instance:
```
Add this to the previous sentence.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]