From 67258781025d0bdc9192fa56595d20a464b47a4d Mon Sep 17 00:00:00 2001 From: Dennis Pan Date: Tue, 6 May 2025 17:57:30 -0700 Subject: [PATCH 1/2] feat: support setting default http lua_shared_dict --- charts/apisix/README.md | 1 + charts/apisix/templates/configmap.yaml | 6 ++++++ charts/apisix/values.yaml | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/charts/apisix/README.md b/charts/apisix/README.md index 520af054..8fc7bd47 100644 --- a/charts/apisix/README.md +++ b/charts/apisix/README.md @@ -93,6 +93,7 @@ The command removes all the Kubernetes components associated with the chart and | apisix.luaModuleHook.luaPath | string | `""` | extend lua_package_path to load third party code | | apisix.nginx.configurationSnippet | object | `{"httpAdmin":"","httpEnd":"","httpSrv":"","httpStart":"","main":"","stream":""}` | Custom configuration snippet. | | 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 | +| 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 | | apisix.nginx.enableCPUAffinity | bool | `true` | | | apisix.nginx.envs | list | `[]` | | | apisix.nginx.keepaliveTimeout | string | `"60s"` | Timeout during which a keep-alive client connection will stay open on the server side. | diff --git a/charts/apisix/templates/configmap.yaml b/charts/apisix/templates/configmap.yaml index 05419451..00681d84 100644 --- a/charts/apisix/templates/configmap.yaml +++ b/charts/apisix/templates/configmap.yaml @@ -206,6 +206,12 @@ data: {{ $dict.name }}: {{ $dict.size }} {{- end }} {{- end }} + {{- if .Values.apisix.nginx.luaSharedDicts }} + lua_shared_dict: + {{- range $dict := .Values.apisix.nginx.luaSharedDicts }} + - {{ $dict.name }}: {{ $dict.size }} + {{- end }} + {{- end }} {{- if .Values.apisix.nginx.configurationSnippet.main }} main_configuration_snippet: {{- toYaml .Values.apisix.nginx.configurationSnippet.main | indent 6 }} {{- end }} diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml index f552c7dc..7aabed78 100644 --- a/charts/apisix/values.yaml +++ b/charts/apisix/values.yaml @@ -440,7 +440,7 @@ apisix: stream: | - # -- Add custom [lua_shared_dict](https://github.com/openresty/lua-nginx-module#toc88) settings, + # -- 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 customLuaSharedDicts: [] # - name: foo @@ -448,6 +448,12 @@ apisix: # - name: bar # size: 1m + # -- 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 + luaSharedDicts: [] + # - name: prometheus-metrics + # size: 20m + discovery: # -- Enable or disable Apache APISIX integration service discovery enabled: false From b650b16a98f150eb9aff7e4c567bd9f1749ca865 Mon Sep 17 00:00:00 2001 From: Nic Date: Fri, 6 Jun 2025 09:09:06 +0800 Subject: [PATCH 2/2] helm docs Signed-off-by: Nic --- charts/apisix/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/apisix/README.md b/charts/apisix/README.md index 8fc7bd47..16ad274d 100644 --- a/charts/apisix/README.md +++ b/charts/apisix/README.md @@ -92,8 +92,7 @@ The command removes all the Kubernetes components associated with the chart and | 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" | | apisix.luaModuleHook.luaPath | string | `""` | extend lua_package_path to load third party code | | apisix.nginx.configurationSnippet | object | `{"httpAdmin":"","httpEnd":"","httpSrv":"","httpStart":"","main":"","stream":""}` | Custom configuration snippet. | -| 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 | -| 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 | +| 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 | | apisix.nginx.enableCPUAffinity | bool | `true` | | | apisix.nginx.envs | list | `[]` | | | apisix.nginx.keepaliveTimeout | string | `"60s"` | Timeout during which a keep-alive client connection will stay open on the server side. | @@ -103,6 +102,7 @@ The command removes all the Kubernetes components associated with the chart and | apisix.nginx.logs.enableAccessLog | bool | `true` | Enable access log or not, default true | | apisix.nginx.logs.errorLog | string | `"/dev/stderr"` | Error log path | | apisix.nginx.logs.errorLogLevel | string | `"warn"` | Error log level | +| 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 | | apisix.nginx.workerConnections | string | `"10620"` | | | apisix.nginx.workerProcesses | string | `"auto"` | | | apisix.nginx.workerRlimitNofile | string | `"20480"` | |