Skip to content

Commit

Permalink
feat: support lua shared dict configuration (#113)
Browse files Browse the repository at this point in the history
Signed-off-by: Nic <[email protected]>
  • Loading branch information
nic-6443 authored Jun 14, 2024
1 parent 98e2cf8 commit 12a5c74
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 2 deletions.
16 changes: 15 additions & 1 deletion charts/api7/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# api7ee3

![Version: 0.12.13](https://img.shields.io/badge/Version-0.12.13-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)
![Version: 0.13.2](https://img.shields.io/badge/Version-0.13.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.0.0](https://img.shields.io/badge/AppVersion-3.0.0-informational?style=flat-square)

A Helm chart for Kubernetes

Expand Down Expand Up @@ -44,6 +44,13 @@ A Helm chart for Kubernetes
| dashboard_configuration.server.tls.port | int | `7443` | |
| dashboard_configuration.session_options_config.same_site | string | `"lax"` | |
| dashboard_configuration.session_options_config.secure | bool | `false` | |
| dashboard_service.ingress.annotations | object | `{}` | |
| dashboard_service.ingress.className | string | `""` | |
| dashboard_service.ingress.enabled | bool | `false` | |
| dashboard_service.ingress.hosts[0].host | string | `"dashboard.local"` | |
| dashboard_service.ingress.hosts[0].paths[0].path | string | `"/"` | |
| dashboard_service.ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
| dashboard_service.ingress.tls | list | `[]` | |
| dashboard_service.port | int | `7080` | |
| dashboard_service.tlsPort | int | `7443` | |
| dashboard_service.type | string | `"ClusterIP"` | |
Expand All @@ -59,6 +66,13 @@ A Helm chart for Kubernetes
| dp_manager_configuration.server.listen.port | int | `7900` | |
| dp_manager_configuration.server.tls.host | string | `"0.0.0.0"` | |
| dp_manager_configuration.server.tls.port | int | `7943` | |
| dp_manager_service.ingress.annotations | object | `{}` | |
| dp_manager_service.ingress.className | string | `""` | |
| dp_manager_service.ingress.enabled | bool | `false` | |
| dp_manager_service.ingress.hosts[0].host | string | `"dp-manager.local"` | |
| dp_manager_service.ingress.hosts[0].paths[0].path | string | `"/"` | |
| dp_manager_service.ingress.hosts[0].paths[0].pathType | string | `"ImplementationSpecific"` | |
| dp_manager_service.ingress.tls | list | `[]` | |
| dp_manager_service.port | int | `7900` | |
| dp_manager_service.tlsPort | int | `7943` | |
| dp_manager_service.type | string | `"ClusterIP"` | |
Expand Down
2 changes: 1 addition & 1 deletion charts/gateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.4
version: 0.1.5

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
31 changes: 31 additions & 0 deletions charts/gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,31 @@ The command removes all the Kubernetes components associated with the chart and
| apisix.enabled | bool | `true` | Enable or disable API7 Gateway itself |
| 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 |
| apisix.hostNetwork | bool | `false` | |
| apisix.http.luaSharedDict.access-tokens | string | `"1m"` | |
| apisix.http.luaSharedDict.balancer-ewma | string | `"10m"` | |
| apisix.http.luaSharedDict.balancer-ewma-last-touched-at | string | `"10m"` | |
| apisix.http.luaSharedDict.balancer-ewma-locks | string | `"10m"` | |
| apisix.http.luaSharedDict.cas-auth | string | `"10m"` | |
| apisix.http.luaSharedDict.discovery | string | `"1m"` | |
| apisix.http.luaSharedDict.etcd-cluster-health-check | string | `"10m"` | |
| apisix.http.luaSharedDict.ext-plugin | string | `"1m"` | |
| apisix.http.luaSharedDict.internal-status | string | `"10m"` | |
| apisix.http.luaSharedDict.introspection | string | `"10m"` | |
| apisix.http.luaSharedDict.jwks | string | `"1m"` | |
| apisix.http.luaSharedDict.lrucache-lock | string | `"10m"` | |
| apisix.http.luaSharedDict.plugin-api-breaker | string | `"10m"` | |
| apisix.http.luaSharedDict.plugin-graphql-limit-count | string | `"10m"` | |
| apisix.http.luaSharedDict.plugin-graphql-limit-count-reset-header | string | `"10m"` | |
| apisix.http.luaSharedDict.plugin-limit-conn | string | `"10m"` | |
| apisix.http.luaSharedDict.plugin-limit-count | string | `"10m"` | |
| apisix.http.luaSharedDict.plugin-limit-count-redis-cluster-slot-lock | string | `"1m"` | |
| apisix.http.luaSharedDict.plugin-limit-req | string | `"10m"` | |
| apisix.http.luaSharedDict.prometheus-metrics | string | `"10m"` | |
| apisix.http.luaSharedDict.saml_sessions | string | `"10m"` | |
| apisix.http.luaSharedDict.tars | string | `"1m"` | |
| apisix.http.luaSharedDict.tracing_buffer | string | `"10m"` | |
| apisix.http.luaSharedDict.upstream-healthcheck | string | `"10m"` | |
| apisix.http.luaSharedDict.worker-events | string | `"10m"` | |
| apisix.httpRouter | string | `"radixtree_host_uri"` | Defines how apisix handles routing: - radixtree_uri: match route by uri(base on radixtree) - radixtree_host_uri: match route by host + uri(base on radixtree) - radixtree_uri_with_parameter: match route by uri with parameters |
| apisix.image.pullPolicy | string | `"Always"` | API7 Gateway image pull policy |
| apisix.image.repository | string | `"api7/api7-ee-3-gateway"` | API7 Gateway image repository |
Expand All @@ -83,6 +108,12 @@ The command removes all the Kubernetes components associated with the chart and
| apisix.resources | object | `{}` | Set pod resource requests & limits |
| apisix.securityContext | object | `{}` | Set the securityContext for API7 Gateway container |
| apisix.setIDFromPodUID | bool | `false` | Use Pod metadata.uid as the APISIX id. |
| apisix.stream.luaSharedDict.config-stream | string | `"5m"` | |
| apisix.stream.luaSharedDict.etcd-cluster-health-check-stream | string | `"10m"` | |
| apisix.stream.luaSharedDict.lrucache-lock-stream | string | `"10m"` | |
| apisix.stream.luaSharedDict.plugin-limit-conn-stream | string | `"10m"` | |
| apisix.stream.luaSharedDict.tars-stream | string | `"1m"` | |
| apisix.stream.luaSharedDict.worker-events-stream | string | `"10m"` | |
| apisix.timezone | string | `""` | timezone is the timezone where apisix uses. For example: "UTC" or "Asia/Shanghai" This value will be set on apisix container's environment variable TZ. You may need to set the timezone to be consistent with your local time zone, otherwise the apisix's logs may used to retrieve event maybe in wrong timezone. |
| apisix.tolerations | list | `[]` | List of node taints to tolerate |
| autoscaling.enabled | bool | `false` | |
Expand Down
9 changes: 9 additions & 0 deletions charts/gateway/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,11 @@ data:
- {{ $env }}
{{- end }}
{{- end }}
stream:
{{- if .Values.apisix.stream.luaSharedDict }}
lua_shared_dict:
{{- toYaml .Values.apisix.stream.luaSharedDict | nindent 10 }}
{{- end }}
http:
enable_access_log: {{ .Values.logs.enableAccessLog }}
{{- if .Values.logs.enableAccessLog }}
Expand All @@ -154,6 +159,10 @@ data:
{{ $dict.name }}: {{ $dict.size }}
{{- end }}
{{- end }}
{{- if .Values.apisix.http.luaSharedDict }}
lua_shared_dict:
{{- toYaml .Values.apisix.http.luaSharedDict | nindent 10 }}
{{- end }}
{{- if .Values.configurationSnippet.main }}
main_configuration_snippet: {{- toYaml .Values.configurationSnippet.main | indent 6 }}
{{- end }}
Expand Down
37 changes: 37 additions & 0 deletions charts/gateway/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,43 @@ apisix:
# -- Use Pod metadata.uid as the APISIX id.
setIDFromPodUID: false

stream:
luaSharedDict:
etcd-cluster-health-check-stream: 10m
lrucache-lock-stream: 10m
plugin-limit-conn-stream: 10m
worker-events-stream: 10m
tars-stream: 1m
config-stream: 5m

http:
luaSharedDict:
internal-status: 10m
plugin-limit-req: 10m
plugin-limit-count: 10m
prometheus-metrics: 10m
plugin-limit-conn: 10m
plugin-graphql-limit-count: 10m
plugin-graphql-limit-count-reset-header: 10m
upstream-healthcheck: 10m
worker-events: 10m
lrucache-lock: 10m
balancer-ewma: 10m
balancer-ewma-locks: 10m
balancer-ewma-last-touched-at: 10m
plugin-limit-count-redis-cluster-slot-lock: 1m
tracing_buffer: 10m
plugin-api-breaker: 10m
etcd-cluster-health-check: 10m
discovery: 1m
jwks: 1m
introspection: 10m
access-tokens: 1m
ext-plugin: 1m
tars: 1m
cas-auth: 10m
saml_sessions: 10m

# -- 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
customLuaSharedDicts: []
Expand Down

0 comments on commit 12a5c74

Please sign in to comment.