Skip to content

Commit bdfe0b7

Browse files
authored
feat: add trusted_addresses option to apisix configmap template (#909)
1 parent 379ab73 commit bdfe0b7

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

charts/apisix/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ type: application
3131
# This is the chart version. This version number should be incremented each time you make changes
3232
# to the chart and its templates, including the app version.
3333
# Versions are expected to follow Semantic Versioning (https://semver.org/)
34-
version: 2.12.3
34+
version: 2.12.4
3535

3636
# This is the version number of the application being deployed. This version number should be
3737
# incremented each time you make changes to the application. Versions are not expected to

charts/apisix/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ The command removes all the Kubernetes components associated with the chart and
128128
| apisix.status.ip | string | `"0.0.0.0"` | |
129129
| apisix.status.port | int | `7085` | |
130130
| apisix.stream_plugins | list | `[]` | Customize the list of APISIX stream_plugins to enable. By default, APISIX's [default stream_plugins](https://github.com/apache/apisix/blob/master/apisix/cli/config.lua#L294) are automatically used. |
131+
| apisix.trustedAddresses | list | `["127.0.0.1"]` | When configured, APISIX will trust the `X-Forwarded-*` Headers passed in requests from the IP/CIDR in the list. |
131132
| apisix.vault.enabled | bool | `false` | Enable or disable the vault integration |
132133
| apisix.vault.host | string | `""` | The host address where the vault server is running. |
133134
| apisix.vault.prefix | string | `""` | Prefix allows you to better enforcement of policies. |

charts/apisix/templates/configmap.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,11 @@ data:
176176
port: {{ default "7085" (.Values.apisix.status.port | toString) }}
177177
{{- end}}
178178
179+
{{ if .Values.apisix.trustedAddresses }}
180+
trusted_addresses:
181+
{{- toYaml .Values.apisix.trustedAddresses | nindent 8 }}
182+
{{ end }}
183+
179184
nginx_config: # config for render the template to genarate nginx.conf
180185
error_log: "{{ .Values.apisix.nginx.logs.errorLog }}"
181186
error_log_level: "{{ .Values.apisix.nginx.logs.errorLogLevel }}" # warn,error

charts/apisix/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,10 @@ apisix:
585585
ip: "0.0.0.0"
586586
port: 7085
587587

588+
# -- When configured, APISIX will trust the `X-Forwarded-*` Headers passed in requests from the IP/CIDR in the list.
589+
trustedAddresses:
590+
- 127.0.0.1
591+
588592
# -- external etcd configuration. If etcd.enabled is false, these configuration will be used.
589593
externalEtcd:
590594
# -- if etcd.enabled is false, use external etcd, support multiple address, if your etcd cluster enables TLS, please use https scheme, e.g. https://127.0.0.1:2379.

0 commit comments

Comments
 (0)