Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: set default router flavor to expressions if KIC >=3.0 and traditional_compatible otherwide #935

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion charts/kong/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
13 changes: 13 additions & 0 deletions charts/kong/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 ======
Expand Down Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I understand this also changes the default when KIC is < 3.0.0 from traditional to traditional_compatible, is this intended?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on keeping whatever was the default - traditional for KIC <3.0.

{{- end -}}
{{- end -}}
{{- end -}}
5 changes: 0 additions & 5 deletions charts/kong/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading