feat: support to configure custom lua shared dicts

Signed-off-by: Chao Zhang <tokers@apache.org>
diff --git a/charts/apisix/templates/configmap.yaml b/charts/apisix/templates/configmap.yaml
index 8ed462b..278f5cf 100644
--- a/charts/apisix/templates/configmap.yaml
+++ b/charts/apisix/templates/configmap.yaml
@@ -153,8 +153,12 @@
         real_ip_from:                  # http://nginx.org/en/docs/http/ngx_http_realip_module.html#set_real_ip_from
           - 127.0.0.1
           - 'unix:'
-        #lua_shared_dicts:              # add custom shared cache to nginx.conf
-        #  ipc_shared_dict: 100m        # custom shared cache, format: `cache-key: cache-size`
+        {{- if .Values.apisix.customLuaSharedDicts }}
+        lua_shared_dicts:              # add custom shared cache to nginx.conf
+        {{- range $dict := .Values.apisix.customLuaSharedDicts }}
+          {{ $dict.name }}: {{ $dict.size }}
+        {{- end }}
+        {{- end }}
 
     etcd:
     {{- if .Values.etcd.enabled }}
diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml
index e4a161d..247ec74 100644
--- a/charts/apisix/values.yaml
+++ b/charts/apisix/values.yaml
@@ -23,6 +23,12 @@
   # Set it to false and ingress-controller.enabled=true will deploy only ingress-controller
   enabled: true
 
+  customLuaSharedDicts: []
+    # - name: foo
+    #   size: 10k
+    # - name: bar
+    #   size: 1m
+
   image:
     repository: apache/apisix
     pullPolicy: IfNotPresent