diff --git a/charts/apisix/README.md b/charts/apisix/README.md index 520af054..4f694397 100644 --- a/charts/apisix/README.md +++ b/charts/apisix/README.md @@ -111,6 +111,8 @@ The command removes all the Kubernetes components associated with the chart and | apisix.prometheus.enabled | bool | `false` | | | apisix.prometheus.metricPrefix | string | `"apisix_"` | prefix of the metrics | | apisix.prometheus.path | string | `"/apisix/prometheus/metrics"` | path of the metrics endpoint | +| apisix.proxy_cache | object | `{"zones":[]}` | Customize APISIX proxy_cache plugin settings. | +| apisix.proxy_cache.zones | list | `[]` | Customize additional cache zones. See [proxy_cache plugin](https://apisix.apache.org/docs/apisix/plugins/proxy-cache/#enable-plugin) | | apisix.router.http | 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.setIDFromPodUID | bool | `false` | Use Pod metadata.uid as the APISIX id. | | apisix.ssl.additionalContainerPorts | list | `[]` | Support multiple https ports, See [Configuration](https://github.com/apache/apisix/blob/0bc65ea9acd726f79f80ae0abd8f50b7eb172e3d/conf/config-default.yaml#L99) | diff --git a/charts/apisix/templates/configmap.yaml b/charts/apisix/templates/configmap.yaml index 05419451..38462450 100644 --- a/charts/apisix/templates/configmap.yaml +++ b/charts/apisix/templates/configmap.yaml @@ -99,13 +99,19 @@ data: # disk_size: 1G # disk_path: "/tmp/disk_cache_two" # cache_levels: "1:2" + {{- if .Values.apisix.proxy_cache.zones }} + {{- $zones := toYaml .Values.apisix.proxy_cache.zones -}} + {{- if gt (len ($zones | fromYaml)) 0 }} + {{- $zones | nindent 8 }} + {{- end }} + {{- end }} router: http: {{ .Values.apisix.router.http }} # 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 ssl: 'radixtree_sni' # radixtree_sni: match route by SNI(base on radixtree) - + {{- $proxy_mode := "" }} {{- if and .Values.service.stream.enabled .Values.service.http.enabled }} {{- $proxy_mode = "http&stream" }} diff --git a/charts/apisix/values.schema.json b/charts/apisix/values.schema.json index 03c15b01..26f769b9 100644 --- a/charts/apisix/values.schema.json +++ b/charts/apisix/values.schema.json @@ -19,6 +19,40 @@ "minItems": 0, "uniqueItems": true }, + "proxy_cache": { + "description": "APISIX proxy_cache zones settings", + "type": "object", + "properties": { + "zones": { + "type": "array", + "minItems": 0, + "items": { + "type": "object", + "properties": { + "name": { + "type": "string", + "minLength": 1 + }, + "memory_size": { + "type": "string", + "minLength": 2 + }, + "disk_size": { + "type": "string", + "minLength": 2 + }, + "disk_path": { + "type": "string" + }, + "cache_levels": { + "type": "string" + } + }, + "required": ["name", "memory_size"] + } + } + } + }, "customPlugins": { "description": "customPlugins allows you to mount your own HTTP plugins", "type": "object", diff --git a/charts/apisix/values.yaml b/charts/apisix/values.yaml index f552c7dc..4cf0de68 100644 --- a/charts/apisix/values.yaml +++ b/charts/apisix/values.yaml @@ -530,6 +530,10 @@ apisix: plugins: [] # -- Customize the list of APISIX stream_plugins to enable. By default, APISIX's default stream_plugins are automatically used. See [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml) stream_plugins: [] + # -- Customize APISIX proxy_cache plugin settings. + proxy_cache: + # -- Customize additional cache zones. See [proxy_cache plugin](https://apisix.apache.org/docs/apisix/plugins/proxy-cache/#enable-plugin) + zones: [] # -- Set APISIX plugin attributes, see [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L376) for more details pluginAttrs: {}