diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index 405e85b9c..2a69e95a6 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -9,6 +9,8 @@ to avoid collisions in case of multiple installations. [#1211](https://github.com/Kong/charts/pull/1211) * Bumped default `kong` image tag to 3.9. [#1219](https://github.com/Kong/charts/pull/1219) +* Option to add pre-installed plugins to plugin list [#1214](https://github.com/Kong/charts/pull/1214) + ## 2.46.0 diff --git a/charts/kong/README.md b/charts/kong/README.md index 62425e1c5..989314dc7 100644 --- a/charts/kong/README.md +++ b/charts/kong/README.md @@ -617,7 +617,7 @@ directory. | image.pullPolicy | Image pull policy | `IfNotPresent` | | image.pullSecrets | Image pull secrets | `null` | | replicaCount | Kong instance count. It has no effect when `autoscaling.enabled` is set to true | `1` | -| plugins | Install custom plugins into Kong via ConfigMaps or Secrets | `{}` | +| plugins | Install custom plugins into Kong via ConfigMaps, Secrets or preInstalled | `{}` | | env | Additional [Kong configurations](https://getkong.org/docs/latest/configuration/) | | | customEnv | Custom Environment variables without `KONG_` prefix | | | envFrom | Populate environment variables from ConfigMap or Secret keys | | diff --git a/charts/kong/templates/_helpers.tpl b/charts/kong/templates/_helpers.tpl index 3635f9e60..a83f0e7fe 100644 --- a/charts/kong/templates/_helpers.tpl +++ b/charts/kong/templates/_helpers.tpl @@ -843,6 +843,12 @@ The name of the Service which will be used by the controller to update the Ingre {{- range .Values.plugins.secrets -}} {{ $myList = append $myList .pluginName -}} {{- end }} +{{- if .Values.plugins.preInstalled -}} + {{- $preInstalledPlugins := split "," .Values.plugins.preInstalled -}} + {{- range $preInstalledPlugins -}} + {{- $myList = append $myList . -}} + {{- end -}} +{{- end }} {{- $myList | uniq | join "," -}} {{- end -}} diff --git a/charts/kong/values.yaml b/charts/kong/values.yaml index 4081e36e8..a16f97183 100644 --- a/charts/kong/values.yaml +++ b/charts/kong/values.yaml @@ -456,6 +456,8 @@ plugins: {} # secrets: # - pluginName: rewriter # name: kong-plugin-rewriter + # If your development cycle preinstalls the plugin as part of the image, this appends them to the plugins env var + # preInstalled: sweet-plugin,another-sweet-plugin # Inject specified secrets as a volume in Kong Container at path /etc/secrets/{secret-name}/ # This can be used to override default SSL certificates. # Be aware that the secret name will be used verbatim, and that certain types