diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index 47ff4b7db..ef30d8fa8 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -8,9 +8,11 @@ [#917](https://github.com/Kong/charts/pull/917) * Added services resource to admission webhook config for KIC >= 3.0.0. [#919](https://github.com/Kong/charts/pull/919) -* Update default ingress controller version to v3.0 +* Update default ingress controller version to v3.0. [#929](https://github.com/Kong/charts/pull/929) [#930](https://github.com/Kong/charts/pull/930) +* Set default router flavor to `expressions` for KIC >= 3.0.0. + [#935](https://github.com/Kong/charts/pull/935) ### Fixed diff --git a/charts/kong/templates/_helpers.tpl b/charts/kong/templates/_helpers.tpl index bd2f83d5f..cac8c10b3 100644 --- a/charts/kong/templates/_helpers.tpl +++ b/charts/kong/templates/_helpers.tpl @@ -1144,6 +1144,7 @@ the template that it itself is using form the above sections. {{- end }} {{- $_ := set $autoEnv "KONG_PLUGINS" (include "kong.plugins" .) -}} +{{- $_ := set $autoEnv "KONG_ROUTER_FLAVOR" (include "kong.router_flavor" .) -}} {{/* ====== USER-SET ENVIRONMENT VARIABLES ====== @@ -1710,3 +1711,15 @@ extensions/v1beta1 {{- end -}} {{- (toYaml $proxyReadiness) -}} {{- end -}} + +{{- define "kong.router_flavor" -}} +{{- if .Values.env.router_flavor -}} +.Values.env.router_flavor +{{- else -}} + {{- if (and .Values.ingressController.enabled (semverCompare ">= 3.0.0" (include "kong.effectiveVersion" .Values.ingressController.image))) -}} + expressions + {{- else -}} + traditional_compatible + {{- end -}} +{{- end -}} +{{- end -}} diff --git a/charts/kong/values.yaml b/charts/kong/values.yaml index 16dd2b5f2..79056f8f0 100644 --- a/charts/kong/values.yaml +++ b/charts/kong/values.yaml @@ -84,11 +84,6 @@ deployment: # is set below. In general, you should not set values here if they are set elsewhere. env: database: "off" - # the chart uses the traditional router (for Kong 3.x+) because the ingress - # controller generates traditional routes. if you do not use the controller, - # you may set this to "traditional_compatible" or "expressions" to use the new - # DSL-based router - router_flavor: "traditional" nginx_worker_processes: "2" proxy_access_log: /dev/stdout admin_access_log: /dev/stdout