diff --git a/charts/ingress/CHANGELOG.md b/charts/ingress/CHANGELOG.md index 8cc7e6a3e..9e1457c2d 100644 --- a/charts/ingress/CHANGELOG.md +++ b/charts/ingress/CHANGELOG.md @@ -11,10 +11,10 @@ - < `2.10.0`: 1. Bump the controller version to >= `3.0.0`. 1. Set `gateway.env.router_flavor` to `traditional` to keep using the old router flavor. - - \>= `2.10.0` and < `3.0.0`: + - < `3.0.0`: 1. Bump the controller version to >= `3.0.0`. 1. Set `gateway.env.router_flavor` to `traditional` to keep using the old router flavor. - 1. Set `controller.env.feature_gates=ExpressionRoutes=true` to use the new router flavor. + 1. Set `controller.ingressController.env.feature_gates=ExpressionRoutes=true` to use the new router flavor. [#939](https://github.com/Kong/charts/pull/939) ## 0.9.0 diff --git a/charts/ingress/Chart.lock b/charts/ingress/Chart.lock index 37828408e..627b54ec7 100644 --- a/charts/ingress/Chart.lock +++ b/charts/ingress/Chart.lock @@ -1,9 +1,9 @@ dependencies: - name: kong - repository: https://charts.konghq.com - version: 2.31.0 + repository: file://../kong/ + version: 2.32.0 - name: kong - repository: https://charts.konghq.com - version: 2.31.0 -digest: sha256:2897c91fb6e37c04f99a413dac85f991fed223591b8de327a04795e27b90a617 -generated: "2023-11-06T14:36:11.845865+01:00" + repository: file://../kong/ + version: 2.32.0 +digest: sha256:237d8d361b79638a5e0730a476383ff38e0dc0e89d8bf16a68d4ae59b7066464 +generated: "2023-11-13T10:56:42.680929+01:00" diff --git a/charts/ingress/Chart.yaml b/charts/ingress/Chart.yaml index 3e3e905b4..4ad0c4f48 100644 --- a/charts/ingress/Chart.yaml +++ b/charts/ingress/Chart.yaml @@ -12,12 +12,12 @@ version: 0.10.0 appVersion: "3.4" dependencies: - name: kong - version: ">=2.31.0" - repository: https://charts.konghq.com + version: ">=2.32.0" + repository: file://../kong/ alias: controller condition: controller.enabled - name: kong - version: ">=2.31.0" - repository: https://charts.konghq.com + version: ">=2.32.0" + repository: file://../kong/ alias: gateway condition: gateway.enabled diff --git a/charts/ingress/templates/validation.tpl b/charts/ingress/templates/validation.tpl index 950ae22f5..079bdf7c3 100644 --- a/charts/ingress/templates/validation.tpl +++ b/charts/ingress/templates/validation.tpl @@ -4,7 +4,7 @@ (semverCompare "< 2.10" (include "kong.effectiveVersion" .Values.controller.ingressController.image)) -}} {{- fail (printf ` -⚠️ Warning! +❌ Error! "kong/ingress" chart in version 0.10.0 has introduced "gateway.env.router_flavor" value defaulting to "expressions". "expressions" router flavor is not supported with Kong Ingress Controller %q that you're using. @@ -27,7 +27,7 @@ gateway: (not (contains "ExpressionRoutes=true" (default "" .Values.controller.ingressController.env.feature_gates))) (semverCompare "< 3.0" (include "kong.effectiveVersion" .Values.controller.ingressController.image)) -}} {{- fail (printf ` -⚠️ Warning! +❌ Error! "kong/ingress" chart in version 0.10.0 has introduced "gateway.env.router_flavor" value defaulting to "expressions". You're using Kong Ingress Controller version %q which supports this feature only when feature flag "ExpressionRoutes=true" is set. diff --git a/charts/ingress/values.yaml b/charts/ingress/values.yaml index 27ddfd0e1..6ad04eb8b 100644 --- a/charts/ingress/values.yaml +++ b/charts/ingress/values.yaml @@ -44,4 +44,3 @@ gateway: env: role: traditional database: "off" - router_flavor: "expressions" diff --git a/charts/kong/CHANGELOG.md b/charts/kong/CHANGELOG.md index 47ff4b7db..3d2751827 100644 --- a/charts/kong/CHANGELOG.md +++ b/charts/kong/CHANGELOG.md @@ -1,5 +1,22 @@ # Changelog +## 2.32.0 + +### Improvements + +- Changed the default router flavor (`env.router_flavor` value) to performance-boosting `expressions`. + It can make `helm install` fail if you're using this chart with Kong Ingress Controller pinned to a version + older than `3.0.0`. + To fix it, you have the following options for given controller versions: + - < `2.10.0`: + 1. Bump the controller version to >= `3.0.0`. + 1. Set `env.router_flavor` to `traditional` to keep using the old router flavor. + - < `3.0.0`: + 1. Bump the controller version to >= `3.0.0`. + 1. Set `env.router_flavor` to `traditional` to keep using the old router flavor. + 1. Set `ingressController.env.feature_gates=ExpressionRoutes=true` to use the new router flavor. + [#939](https://github.com/Kong/charts/pull/939) + ## 2.31.0 ### Improvements diff --git a/charts/kong/Chart.yaml b/charts/kong/Chart.yaml index c70420ecc..8c3885563 100644 --- a/charts/kong/Chart.yaml +++ b/charts/kong/Chart.yaml @@ -8,7 +8,7 @@ maintainers: name: kong sources: - https://github.com/Kong/charts/tree/main/charts/kong -version: 2.31.0 +version: 2.32.0 appVersion: "3.4" dependencies: - name: postgresql diff --git a/charts/kong/ci/admin-api-service-clusterip-values.yaml b/charts/kong/ci/admin-api-service-clusterip-values.yaml index 8204ad463..3ef15ef7e 100644 --- a/charts/kong/ci/admin-api-service-clusterip-values.yaml +++ b/charts/kong/ci/admin-api-service-clusterip-values.yaml @@ -11,8 +11,7 @@ dblessConfig: url: http://example.com routes: - name: example - paths: - - "/example" + expression: http.path ^= "/example" ingressController: enabled: false diff --git a/charts/kong/ci/test3-values.yaml b/charts/kong/ci/test3-values.yaml index 76c5f359a..f98a2e67b 100644 --- a/charts/kong/ci/test3-values.yaml +++ b/charts/kong/ci/test3-values.yaml @@ -37,5 +37,4 @@ dblessConfig: url: http://example.com routes: - name: example - paths: - - "/example" + expression: http.path ^= "/example" diff --git a/charts/kong/ci/test4-values.yaml b/charts/kong/ci/test4-values.yaml index 2f648adcb..cf1c2b9b6 100644 --- a/charts/kong/ci/test4-values.yaml +++ b/charts/kong/ci/test4-values.yaml @@ -31,5 +31,4 @@ dblessConfig: url: http://example.com routes: - name: example - paths: - - "/example" + expression: http.path ^= "/example" diff --git a/charts/kong/templates/validation.tpl b/charts/kong/templates/validation.tpl new file mode 100644 index 000000000..e711bbf7b --- /dev/null +++ b/charts/kong/templates/validation.tpl @@ -0,0 +1,48 @@ +{{- /* Validate 'expressions' router flavor is not used with KIC < 2.10 as it's not supported */}} +{{- if and .Values.ingressController.enabled + (eq .Values.env.router_flavor "expressions") + (semverCompare "< 2.10" (include "kong.effectiveVersion" .Values.ingressController.image)) +-}} + {{- fail (printf ` +❌ Error! + +"kong/kong" chart in version 2.32.0 has introduced "env.router_flavor" value defaulting to "expressions". +"expressions" router flavor is not supported with Kong Ingress Controller %q that you're using. + +✅ How to fix it (alternatives) + +1. Upgrade to Kong Ingress Controller 3.0 to use this feature. + +2. If you want to keep using your Kong Ingress Controller version, set "env.router_flavor" to "traditional" to +backoff to the previous router flavor in your values.yaml: + +env: + router_flavor: "traditional"` .Values.ingressController.image.tag ) -}} +{{- end -}} + +{{- /* Validate that when 'expressions' router flavor is used with KIC < 3.0, feature flag must be set. */ -}} +{{- if and (.Values.ingressController.enabled) + (eq .Values.env.router_flavor "expressions") + (not (contains "ExpressionRoutes=true" (default "" .Values.ingressController.env.feature_gates))) + (semverCompare "< 3.0" (include "kong.effectiveVersion" .Values.ingressController.image)) -}} + {{- fail (printf ` +❌ Error! + +"kong/kong" chart in version 2.32.0 has introduced "env.router_flavor" value defaulting to "expressions". +"expressions" router flavor is not supported with Kong Ingress Controller %q that you're using. + +✅ How to fix it (alternatives) + +1. Upgrade to Kong Ingress Controller 3.0 to use this feature. + +2. Set "ingressController.env.feature_gates" to "ExpressionRoutes=true" to enable this feature in your values.yaml: + +ingressController: + env: + feature_gates: "ExpressionRoutes=true" + +3. Set "env.router_flavor" to "traditional" to use the previous router flavor in your values.yaml: + +env: + router_flavor: "traditional"` .Values.ingressController.image.tag) -}} +{{- end -}} diff --git a/charts/kong/values.yaml b/charts/kong/values.yaml index 16dd2b5f2..a1547af6f 100644 --- a/charts/kong/values.yaml +++ b/charts/kong/values.yaml @@ -84,11 +84,7 @@ 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" + router_flavor: "expressions" nginx_worker_processes: "2" proxy_access_log: /dev/stdout admin_access_log: /dev/stdout