Skip to content

Commit 898d3ca

Browse files
authored
feat: add extraLuaPath and extraLuaCPath (#158)
Signed-off-by: Nic <[email protected]>
1 parent f4b36a1 commit 898d3ca

File tree

4 files changed

+11
-29
lines changed

4 files changed

+11
-29
lines changed

charts/gateway/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type: application
1414
# This is the chart version. This version number should be incremented each time you make changes
1515
# to the chart and its templates, including the app version.
1616
# Versions are expected to follow Semantic Versioning (https://semver.org/)
17-
version: 0.2.2
17+
version: 0.2.3
1818

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

charts/gateway/README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ The command removes all the Kubernetes components associated with the chart and
6464
| apisix.extraEnvVars | list | `[]` | extraEnvVars An array to add extra env vars e.g: extraEnvVars: - name: FOO value: "bar" - name: FOO2 valueFrom: secretKeyRef: name: SECRET_NAME key: KEY |
6565
| apisix.extraEnvVarsCM | string | `""` | |
6666
| apisix.extraEnvVarsSecret | string | `""` | |
67+
| apisix.extraLuaCPath | string | `""` | |
68+
| apisix.extraLuaPath | string | `""` | |
6769
| apisix.hostNetwork | bool | `false` | |
6870
| apisix.http.luaSharedDict.access-tokens | string | `"1m"` | |
6971
| apisix.http.luaSharedDict.balancer-ewma | string | `"10m"` | |
@@ -97,13 +99,6 @@ The command removes all the Kubernetes components associated with the chart and
9799
| apisix.image.repository | string | `"api7/api7-ee-3-gateway"` | API7 Gateway image repository |
98100
| apisix.image.tag | string | `"3.3.2"` | API7 Gateway image tag Overrides the image tag whose default is the chart appVersion. |
99101
| apisix.kind | string | `"Deployment"` | Use a `DaemonSet` or `Deployment` |
100-
| apisix.luaModuleHook | object | `{"configMapRef":{"mounts":[{"key":"","path":""}],"name":""},"enabled":false,"hookPoint":"","luaPath":""}` | Whether to add a custom lua module |
101-
| apisix.luaModuleHook.configMapRef | object | `{"mounts":[{"key":"","path":""}],"name":""}` | configmap that stores the codes |
102-
| apisix.luaModuleHook.configMapRef.mounts[0] | object | `{"key":"","path":""}` | Name of the ConfigMap key, for setting the mapping relationship between ConfigMap key and the lua module code path. |
103-
| apisix.luaModuleHook.configMapRef.mounts[0].path | string | `""` | Filepath of the plugin code, for setting the mapping relationship between ConfigMap key and the lua module code path. |
104-
| apisix.luaModuleHook.configMapRef.name | string | `""` | Name of the ConfigMap where the lua module codes store |
105-
| 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" |
106-
| apisix.luaModuleHook.luaPath | string | `""` | extend lua_package_path to load third party code |
107102
| apisix.meta.luaSharedDict.prometheus-metrics | string | `"15m"` | |
108103
| apisix.nodeSelector | object | `{}` | Node labels for API7 Gateway pod assignment |
109104
| apisix.podAnnotations | object | `{}` | Annotations to add to each pod |

charts/gateway/templates/configmap.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,11 @@ data:
2828
enable_admin: {{ .Values.admin.enabled }}
2929
enable_admin_cors: {{ .Values.admin.cors }}
3030
enable_debug: false
31-
32-
{{- if .Values.apisix.luaModuleHook.enabled }}
33-
lua_module_hook: {{ .Values.apisix.luaModuleHook.hookPoint | quote }}
31+
{{- if .Values.apisix.extraLuaPath }}
32+
extra_lua_path: "{{ .Values.apisix.extraLuaPath }};"
33+
{{- end }}
34+
{{- if .Values.apisix.extraLuaCPath }}
35+
extra_lua_cpath: "{{ .Values.apisix.extraLuaCPath }};"
3436
{{- end }}
3537
3638
enable_dev_mode: false # Sets nginx worker_processes to 1 if set to true

charts/gateway/values.yaml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,9 @@ apisix:
8080
# size: 10k
8181
# - name: bar
8282
# size: 1m
83-
# -- Whether to add a custom lua module
84-
luaModuleHook:
85-
enabled: false
86-
# -- extend lua_package_path to load third party code
87-
luaPath: ""
88-
# -- the hook module which will be used to inject third party code into APISIX
89-
# use the lua require style like: "module.say_hello"
90-
hookPoint: ""
91-
# -- configmap that stores the codes
92-
configMapRef:
93-
# -- Name of the ConfigMap where the lua module codes store
94-
name: ""
95-
# mounts decides how to mount the codes to the container.
96-
mounts:
97-
# -- Name of the ConfigMap key, for setting the mapping relationship between ConfigMap key and the lua module code path.
98-
- key: ""
99-
# -- Filepath of the plugin code, for setting the mapping relationship between ConfigMap key and the lua module code path.
100-
path: ""
83+
84+
extraLuaPath: ""
85+
extraLuaCPath: ""
10186

10287
# -- Defines how apisix handles routing:
10388
# - radixtree_uri: match route by uri(base on radixtree)

0 commit comments

Comments
 (0)