Skip to content

Commit ba02f57

Browse files
authored
feat: support setting default http lua_shared_dict (#822)
1 parent ccc8960 commit ba02f57

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

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?tab=readme-ov-file#lua_shared_dict) 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 |
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.luaSharedDicts | list | `[]` | Override default [lua_shared_dict](https://github.com/apache/apisix/blob/master/conf/config.yaml.example#L250-L276) 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 |
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: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,12 @@ data:
206206
{{ $dict.name }}: {{ $dict.size }}
207207
{{- end }}
208208
{{- end }}
209+
{{- if .Values.apisix.nginx.luaSharedDicts }}
210+
lua_shared_dict:
211+
{{- range $dict := .Values.apisix.nginx.luaSharedDicts }}
212+
- {{ $dict.name }}: {{ $dict.size }}
213+
{{- end }}
214+
{{- end }}
209215
{{- if .Values.apisix.nginx.configurationSnippet.main }}
210216
main_configuration_snippet: {{- toYaml .Values.apisix.nginx.configurationSnippet.main | indent 6 }}
211217
{{- end }}

charts/apisix/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -440,14 +440,20 @@ apisix:
440440
441441
stream: |
442442
443-
# -- Add custom [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings,
443+
# -- Add custom [lua_shared_dict](https://github.com/openresty/lua-nginx-module?tab=readme-ov-file#lua_shared_dict) settings,
444444
# 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
445445
customLuaSharedDicts: []
446446
# - name: foo
447447
# size: 10k
448448
# - name: bar
449449
# size: 1m
450450

451+
# -- Override default [lua_shared_dict](https://github.com/apache/apisix/blob/master/conf/config.yaml.example#L250-L276) settings,
452+
# 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
453+
luaSharedDicts: []
454+
# - name: prometheus-metrics
455+
# size: 20m
456+
451457
discovery:
452458
# -- Enable or disable Apache APISIX integration service discovery
453459
enabled: false

0 commit comments

Comments
 (0)