Skip to content

Commit 40c027f

Browse files
joyyirBaoyuantop
authored andcommitted
feat: override nginx http lua shared dict configurations (#690)
1 parent 9bee0ad commit 40c027f

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

charts/apisix/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ The command removes all the Kubernetes components associated with the chart and
9292
| apisix.luaModuleHook.hookPoint | string | `""` | the hook module which will be used to inject third party code into APISIX use the lua require style like: "module.say_hello" |
9393
| apisix.luaModuleHook.luaPath | string | `""` | extend lua_package_path to load third party code |
9494
| apisix.nginx.configurationSnippet | object | `{"httpAdmin":"","httpEnd":"","httpSrv":"","httpStart":"","main":"","stream":""}` | Custom configuration snippet. |
95-
| apisix.nginx.customLuaSharedDicts | list | `[]` | Add custom [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings, click [here](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L27-L30) to learn the format of a shared dict |
95+
| apisix.nginx.customLuaSharedDicts | list | `[]` | Add custom [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings, click [here](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L48-L51) to learn the format of a shared dict |
9696
| apisix.nginx.enableCPUAffinity | bool | `true` | |
9797
| apisix.nginx.envs | list | `[]` | |
9898
| apisix.nginx.keepaliveTimeout | string | `"60s"` | Timeout during which a keep-alive client connection will stay open on the server side. |
@@ -102,6 +102,7 @@ The command removes all the Kubernetes components associated with the chart and
102102
| apisix.nginx.logs.enableAccessLog | bool | `true` | Enable access log or not, default true |
103103
| apisix.nginx.logs.errorLog | string | `"/dev/stderr"` | Error log path |
104104
| apisix.nginx.logs.errorLogLevel | string | `"warn"` | Error log level |
105+
| apisix.nginx.luaSharedDictsOverride | object | `{}` | Overrides [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings, click [here](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L258) to view the default values. |
105106
| apisix.nginx.workerConnections | string | `"10620"` | |
106107
| apisix.nginx.workerProcesses | string | `"auto"` | |
107108
| apisix.nginx.workerRlimitNofile | string | `"20480"` | |

charts/apisix/templates/configmap.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ data:
206206
{{ $dict.name }}: {{ $dict.size }}
207207
{{- end }}
208208
{{- end }}
209+
{{- if .Values.apisix.nginx.luaSharedDictsOverride }}
210+
lua_shared_dict: {{- toYaml .Values.apisix.nginx.luaSharedDictsOverride | nindent 10 }}
211+
{{- end }}
209212
{{- if .Values.apisix.nginx.configurationSnippet.main }}
210213
main_configuration_snippet: {{- toYaml .Values.apisix.nginx.configurationSnippet.main | indent 6 }}
211214
{{- end }}

charts/apisix/values.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,13 +441,18 @@ apisix:
441441
stream: |
442442
443443
# -- Add custom [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings,
444-
# click [here](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L27-L30) to learn the format of a shared dict
444+
# click [here](https://github.com/apache/apisix-helm-chart/blob/master/charts/apisix/values.yaml#L48-L51) to learn the format of a shared dict
445445
customLuaSharedDicts: []
446446
# - name: foo
447447
# size: 10k
448448
# - name: bar
449449
# size: 1m
450450

451+
# -- Overrides [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings,
452+
# click [here](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L258) to view the default values.
453+
luaSharedDictsOverride: {}
454+
# prometheus-metrics: 100m
455+
451456
discovery:
452457
# -- Enable or disable Apache APISIX integration service discovery
453458
enabled: false

0 commit comments

Comments
 (0)