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: make expressions router default #939

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion .github/workflows/main-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,8 @@ jobs:
strategy:
matrix:
kic-version:
- "2.10"
- "2.11"
- "2.12"
kong-version:
- "3.3"
- "3.2"
Expand Down
17 changes: 17 additions & 0 deletions charts/ingress/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# Changelog

## 0.10.0

### Improvements

- Changed the default Gateway's router flavor (`gateway.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 `gateway.env.router_flavor` to `traditional` to keep using the old router flavor.
- \>= `2.10.0` and < `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.
[#939](https://github.com/Kong/charts/pull/939)

## 0.9.0

### Improvements
Expand Down
2 changes: 1 addition & 1 deletion charts/ingress/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ maintainers:
name: ingress
sources:
- https://github.com/Kong/charts/tree/main/charts/ingress
version: 0.9.0
version: 0.10.0
appVersion: "3.4"
dependencies:
- name: kong
Expand Down
51 changes: 51 additions & 0 deletions charts/ingress/templates/validation.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{- /* Validate 'expressions' router flavor is not used with KIC < 2.10 as it's not supported */}}
{{- if and .Values.controller.ingressController.enabled
(eq .Values.gateway.env.router_flavor "expressions")
(semverCompare "< 2.10" (include "kong.effectiveVersion" .Values.controller.ingressController.image))
-}}
{{- fail (printf `
⚠️ Warning!

"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.

✅ 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 "gateway.env.router_flavor" to "traditional" to
backoff to the previous router flavor in your values.yaml:

gateway:
env:
router_flavor: "traditional"` .Values.controller.ingressController.image.tag ) -}}
{{- end -}}

{{- /* Validate that when 'expressions' router flavor is used with KIC < 3.0, feature flag must be set. */ -}}
{{- if and (.Values.controller.ingressController.enabled)
(eq .Values.gateway.env.router_flavor "expressions")
(not (contains "ExpressionRoutes=true" (default "" .Values.controller.ingressController.env.feature_gates)))
(semverCompare "< 3.0" (include "kong.effectiveVersion" .Values.controller.ingressController.image)) -}}
{{- fail (printf `
⚠️ Warning!

"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.

✅ How to fix it (alternatives)

1. Upgrade to Kong Ingress Controller 3.0 to use this feature.

2. Set "controller.ingressController.env.feature_gates" to "ExpressionRoutes=true" to enable this feature in your values.yaml:

controller:
ingressController:
env:
feature_gates: "ExpressionRoutes=true"

3. Set "gateway.env.router_flavor" to "traditional" to use the previous router flavor in your values.yaml:

gateway:
env:
router_flavor: "traditional"` .Values.controller.ingressController.image.tag) -}}
{{- end -}}
1 change: 1 addition & 0 deletions charts/ingress/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,4 @@ gateway:
env:
role: traditional
database: "off"
router_flavor: "expressions"
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we add a template to check image of KIC?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Can you please elaborate on what you mean by this? There are two validation rules added in validations.tpl file: one for KIC < 2.10 and one for KIC < 3.0.

10 changes: 9 additions & 1 deletion scripts/test-run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,16 @@ then
fi

# Configure values for all tests
# Enable Gateway API

# Enable feature gates.
if [[ -n "${KIC_VERSION-}" ]]; then
# If testing old version, set ExpressionRoutes.
ADDITIONAL_FLAGS+=("--set ${CONTROLLER_PREFIX}ingressController.env.feature_gates=ExpressionRoutes=true,GatewayAlpha=true")
else
# Otherwise, just GatewayAlpha.
ADDITIONAL_FLAGS+=("--set ${CONTROLLER_PREFIX}ingressController.env.feature_gates=GatewayAlpha=true")
fi

# Tests should not show up in reporting
ADDITIONAL_FLAGS+=("--set ${CONTROLLER_PREFIX}ingressController.env.anonymous_reports=false")

Expand Down
Loading