Skip to content

Commit

Permalink
chore: release 0.1.11 gateway chart (#149)
Browse files Browse the repository at this point in the history
Signed-off-by: Nic <[email protected]>
  • Loading branch information
nic-6443 authored Oct 29, 2024
1 parent 71479c2 commit d31a0b5
Show file tree
Hide file tree
Showing 8 changed files with 40 additions and 223 deletions.
4 changes: 2 additions & 2 deletions charts/gateway/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ 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.10
version: 0.1.11

# 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
# follow Semantic Versioning. They should reflect the version the application is using.
appVersion: "3.2.0"
appVersion: "3.2.16.3"

dependencies:
- name: etcd
Expand Down
26 changes: 11 additions & 15 deletions charts/gateway/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ The command removes all the Kubernetes components associated with the chart and
| apisix.enableServerTokens | bool | `true` | Whether the APISIX version number should be shown in Server header |
| 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.extraEnvVarsCM | string | `""` | |
| apisix.extraEnvVarsSecret | string | `""` | |
| apisix.hostNetwork | bool | `false` | |
| apisix.http.luaSharedDict.access-tokens | string | `"1m"` | |
| apisix.http.luaSharedDict.balancer-ewma | string | `"10m"` | |
Expand Down Expand Up @@ -90,7 +92,7 @@ The command removes all the Kubernetes components associated with the chart and
| 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 |
| apisix.image.tag | string | `"3.2.7.1"` | API7 Gateway image tag Overrides the image tag whose default is the chart appVersion. |
| apisix.image.tag | string | `"3.2.16.3"` | API7 Gateway image tag Overrides the image tag whose default is the chart appVersion. |
| apisix.kind | string | `"Deployment"` | Use a `DaemonSet` or `Deployment` |
| apisix.luaModuleHook | object | `{"configMapRef":{"mounts":[{"key":"","path":""}],"name":""},"enabled":false,"hookPoint":"","luaPath":""}` | Whether to add a custom lua module |
| apisix.luaModuleHook.configMapRef | object | `{"mounts":[{"key":"","path":""}],"name":""}` | configmap that stores the codes |
Expand Down Expand Up @@ -127,14 +129,6 @@ The command removes all the Kubernetes components associated with the chart and
| autoscaling.targetMemoryUtilizationPercentage | int | `80` | |
| autoscaling.version | string | `"v2"` | HPA version, the value is "v2" or "v2beta1", default "v2" |
| configurationSnippet | object | `{"httpAdmin":"","httpEnd":"","httpSrv":"","httpSrvLocation":"","httpStart":"","main":"","stream":""}` | Custom configuration snippet. |
| customPlugins | object | `{"enabled":false,"luaPath":"/opts/custom_plugins/?.lua","plugins":[{"attrs":{},"configMap":{"mounts":[{"key":"the-file-name","path":"mount-path"}],"name":"configmap-name"},"name":"plugin-name"}]}` | customPlugins allows you to mount your own HTTP plugins. |
| customPlugins.enabled | bool | `false` | Whether to configure some custom plugins |
| customPlugins.luaPath | string | `"/opts/custom_plugins/?.lua"` | the lua_path that tells APISIX where it can find plugins, note the last ';' is required. |
| customPlugins.plugins[0] | object | `{"attrs":{},"configMap":{"mounts":[{"key":"the-file-name","path":"mount-path"}],"name":"configmap-name"},"name":"plugin-name"}` | plugin name. |
| customPlugins.plugins[0].attrs | object | `{}` | plugin attrs |
| customPlugins.plugins[0].configMap | object | `{"mounts":[{"key":"the-file-name","path":"mount-path"}],"name":"configmap-name"}` | plugin codes can be saved inside configmap object. |
| customPlugins.plugins[0].configMap.mounts | list | `[{"key":"the-file-name","path":"mount-path"}]` | since keys in configmap is flat, mountPath allows to define the mount path, so that plugin codes can be mounted hierarchically. |
| customPlugins.plugins[0].configMap.name | string | `"configmap-name"` | name of configmap. |
| deployment.certs | object | `{"cert":"","cert_key":"","certsSecret":"","mTLSCACert":"","mTLSCACertSecret":""}` | certs used for certificates in decoupled mode |
| deployment.certs.cert | string | `""` | cert name in certsSecret |
| deployment.certs.cert_key | string | `""` | cert key in certsSecret |
Expand Down Expand Up @@ -178,8 +172,6 @@ The command removes all the Kubernetes components associated with the chart and
| etcd.prefix | string | `"/apisix"` | apisix configurations prefix |
| etcd.timeout | int | `30` | Set the timeout value in seconds for subsequent socket operations from apisix to etcd cluster |
| etcd.user | string | `""` | if etcd.enabled is false, username for external etcd. If etcd.enabled is true, use etcd.auth.rbac.rootPassword instead. |
| extPlugin.cmd | list | `["/path/to/apisix-plugin-runner/runner","run"]` | the command and its arguements to run as a subprocess |
| extPlugin.enabled | bool | `false` | Enable External Plugins. See [external plugin](https://apisix.apache.org/docs/apisix/next/external-plugin/) |
| extraInitContainers | list | `[]` | Additional `initContainers`, See [Kubernetes initContainers](https://kubernetes.io/docs/concepts/workloads/pods/init-containers/) for the detail. |
| extraVolumeMounts | list | `[]` | Additional `volume`, See [Kubernetes Volumes](https://kubernetes.io/docs/concepts/storage/volumes/) for the detail. |
| extraVolumes | list | `[]` | Additional `volume`, See [Kubernetes Volumes](https://kubernetes.io/docs/concepts/storage/volumes/) for the detail. |
Expand Down Expand Up @@ -214,7 +206,6 @@ The command removes all the Kubernetes components associated with the chart and
| nginx.workerProcesses | string | `"auto"` | |
| nginx.workerRlimitNofile | string | `"20480"` | |
| pluginAttrs | object | `{}` | Set APISIX plugin attributes, see [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml#L376) for more details |
| plugins | list | `[]` | Customize the list of APISIX plugins to enable. By default, APISIX's default plugins are automatically used. See [config-default.yaml](https://github.com/apache/apisix/blob/master/conf/config-default.yaml) |
| rbac.create | bool | `false` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.create | bool | `false` | |
Expand All @@ -229,12 +220,17 @@ The command removes all the Kubernetes components associated with the chart and
| serviceMonitor.name | string | `""` | name of the serviceMonitor, by default, it is the same as the apisix fullname |
| serviceMonitor.namespace | string | `""` | namespace where the serviceMonitor is deployed, by default, it is the same as the namespace of the apisix |
| serviceMonitor.path | string | `"/apisix/prometheus/metrics"` | path of the metrics endpoint |
| stream_plugins | list | `[]` | 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) |
| updateStrategy | object | `{}` | |
| vault.enabled | bool | `false` | Enable or disable the vault integration |
| vault.host | string | `""` | The host address where the vault server is running. |
| vault.prefix | string | `""` | Prefix allows you to better enforcement of policies. |
| vault.timeout | int | `10` | HTTP timeout for each request. |
| vault.token | string | `""` | The generated token from vault instance that can grant access to read data from the vault. |
| wasmPlugins.enabled | bool | `false` | Enable Wasm Plugins. See [wasm plugin](https://apisix.apache.org/docs/apisix/next/wasm/) |
| wasmPlugins.plugins | list | `[]` | |

## Upgrading

### To 0.1.11

Remove configuration items such as `plugins`, `stream_plugins`, and `custom_plugins` that are no longer needed in API7 EE.

**This version of the helm chart needs to be used with API7 EE gateway version 3.2.16.3 or above.**
9 changes: 9 additions & 0 deletions charts/gateway/README.md.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,12 @@ The command removes all the Kubernetes components associated with the chart and
## Parameters

{{ template "chart.valuesSection" . }}


## Upgrading

### To 0.1.11

Remove configuration items such as `plugins`, `stream_plugins`, and `custom_plugins` that are no longer needed in API7 EE.

**This version of the helm chart needs to be used with API7 EE gateway version 3.2.16.3 or above.**
7 changes: 0 additions & 7 deletions charts/gateway/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,6 @@ prometheus:
export_uri: {{ .Values.serviceMonitor.path }}
metric_prefix: {{ .Values.serviceMonitor.metricPrefix }}
{{- end }}
{{- if .Values.customPlugins.enabled }}
{{- range $plugin := .Values.customPlugins.plugins }}
{{- if $plugin.attrs }}
{{ $plugin.name }}: {{- $plugin.attrs | toYaml | nindent 2 }}
{{- end }}
{{- end }}
{{- end }}
{{- end -}}

{{- define "apisix.pluginAttrs" -}}
Expand Down
41 changes: 9 additions & 32 deletions charts/gateway/templates/_pod.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,15 @@ spec:
name: {{ .Values.admin.credentials.secretName }}
key: viewer
{{- end }}
envFrom:
{{- if .Values.apisix.extraEnvVarsCM }}
- configMapRef:
name: {{ include "apisix.tplvalues.render" (dict "value" .Values.apisix.extraEnvVarsCM "context" $) }}
{{- end }}
{{- if .Values.apisix.extraEnvVarsSecret }}
- secretRef:
name: {{ include "apisix.tplvalues.render" (dict "value" .Values.apisix.extraEnvVarsSecret "context" $) }}
{{- end }}

ports:
- name: http
Expand Down Expand Up @@ -155,24 +164,6 @@ spec:
- mountPath: /etcd-ssl
name: etcd-ssl
{{- end }}
{{- if .Values.customPlugins.enabled }}
{{- range $plugin := .Values.customPlugins.plugins }}
{{- range $mount := $plugin.configMap.mounts }}
{{- if ne $plugin.configMap.name "" }}
- mountPath: {{ $mount.path }}
name: plugin-{{ $plugin.configMap.name }}
subPath: {{ $mount.key }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.apisix.luaModuleHook.enabled }}
{{- range $mount := .Values.apisix.luaModuleHook.configMapRef.mounts }}
- mountPath: {{ $mount.path }}
name: lua-module-hook
subPath: {{ $mount.key }}
{{- end }}
{{- end }}
{{- if .Values.extraVolumeMounts }}
{{- toYaml .Values.extraVolumeMounts | nindent 8 }}
{{- end }}
Expand Down Expand Up @@ -235,20 +226,6 @@ spec:
fieldPath: metadata.uid
name: id
{{- end }}
{{- if .Values.customPlugins.enabled }}
{{- range $plugin := .Values.customPlugins.plugins }}
{{- if ne $plugin.configMap.name "" }}
- name: plugin-{{ $plugin.configMap.name }}
configMap:
name: {{ $plugin.configMap.name }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.apisix.luaModuleHook.enabled }}
- name: lua-module-hook
configMap:
name: {{ .Values.apisix.luaModuleHook.configMapRef.name }}
{{- end }}
{{- if .Values.extraVolumes }}
{{- toYaml .Values.extraVolumes | nindent 4 }}
{{- end }}
Expand Down
41 changes: 1 addition & 40 deletions charts/gateway/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ data:
enable_admin: {{ .Values.admin.enabled }}
enable_admin_cors: {{ .Values.admin.cors }}
enable_debug: false
{{- if or .Values.customPlugins.enabled .Values.apisix.luaModuleHook.enabled }}
extra_lua_path: {{ .Values.customPlugins.luaPath }};{{ .Values.apisix.luaModuleHook.luaPath }}
{{- end }}
{{- if .Values.apisix.luaModuleHook.enabled }}
lua_module_hook: {{ .Values.apisix.luaModuleHook.hookPoint | quote }}
Expand Down Expand Up @@ -216,49 +213,13 @@ data:
prefix: {{ .Values.vault.prefix }}
{{- end }}
{{- if .Values.plugins }}
plugins: # plugin list
{{- range $plugin := .Values.plugins }}
{{- if ne $plugin "" }}
- {{ $plugin }}
{{- end }}
{{- end }}
{{- if .Values.customPlugins.enabled }}
{{- range $plugin := .Values.customPlugins.plugins }}
- {{ $plugin.name }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.stream_plugins }}
stream_plugins:
{{- range $plugin := .Values.stream_plugins }}
{{- if ne $plugin "" }}
- {{ $plugin }}
{{- end }}
{{- end }}
{{- end }}
{{- if .Values.extPlugin.enabled }}
ext-plugin:
cmd:
{{- range $arg := .Values.extPlugin.cmd }}
- {{ $arg }}
{{- end }}
{{- end }}
{{- if or .Values.pluginAttrs .Values.customPlugins.enabled .Values.serviceMonitor.enabled}}
{{- if or .Values.pluginAttrs .Values.serviceMonitor.enabled}}
{{- $pluginAttrs := include "apisix.pluginAttrs" . -}}
{{- if gt (len ($pluginAttrs | fromYaml)) 0 }}
plugin_attr: {{- $pluginAttrs | nindent 6 }}
{{- end }}
{{- end }}
{{- if .Values.wasmPlugins.enabled }}
wasm:
plugins:
{{- toYaml .Values.wasmPlugins.plugins | nindent 8 }}
{{- end }}
deployment:
role: {{ .Values.deployment.role }}
{{- if or (eq .Values.deployment.role "traditional") (eq .Values.deployment.role "control_plane") }}
Expand Down
89 changes: 1 addition & 88 deletions charts/gateway/values.schema.json
Original file line number Diff line number Diff line change
@@ -1,92 +1,5 @@
{
"$schema": "https://json-schema.org/draft-07/schema#",
"properties": {
"plugins": {
"description": "APISIX plugins to be enabled",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0,
"uniqueItems": true
},
"stream_plugins": {
"description": "APISIX stream_plugins to be enabled",
"type": "array",
"items": {
"type": "string"
},
"minItems": 0,
"uniqueItems": true
},
"customPlugins": {
"description": "customPlugins allows you to mount your own HTTP plugins",
"type": "object",
"properties": {
"enabled": {
"type": "boolean"
},
"luaPath": {
"type": "string"
},
"plugins": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"attrs": {
"type": "object"
},
"configMap": {
"type": "object",
"properties": {
"name": {
"type": "string",
"minLength": 1
},
"mounts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"key": {
"type": "string",
"minLength": 1
},
"path": {
"type": "string",
"minLength": 1
}
},
"required": [
"key",
"path"
]
}
}
},
"required": [
"name",
"mounts"
]
}
},
"required": [
"name",
"configMap"
]
}
}
},
"required": [
"enabled",
"luaPath",
"plugins"
]
}
}
}
}
Loading

0 comments on commit d31a0b5

Please sign in to comment.