Skip to content

Commit

Permalink
address comments and add feature gate CombinedServicesFromDifferentHT…
Browse files Browse the repository at this point in the history
…TPRoutes
  • Loading branch information
randmonkey committed Nov 28, 2024
1 parent 8f2943c commit 80affc6
Show file tree
Hide file tree
Showing 15 changed files with 640 additions and 429 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,12 @@ Adding a new version? You'll need three changes:
- Combine Kong gateway services from rules of `HTTPRoute` sharing the same
backends (same combination of group, kind, namespace, name, port and weight)
from different `HTTPRoute` in the same namespace.
The name of translated Kong gateway service in changed to
`httproute.<namespace>.svc.<backend_ns>.<backend_name>.<backend_port>.[backend_weight]_[next_backends]...`,
like: `httproute.default.svc.default.svc1.80.90_default.svc2.80.10`.
The feature is enabled when feature gate `CombinedServicesFromDifferentHTTPRoutes`
is enabled. The feature gate is disabled by default.
The name of translated Kong gateway service is changed to
`httproute.<namespace>.svc.<backend_ns>.<backend_name>.<backend_port>.[backend_weight]_[next_backends]...`
when the feature is enabled, like:
`httproute.default.svc.default.svc1.80.90_default.svc2.80.10`.
[#6711](https://github.com/Kong/kubernetes-ingress-controller/pull/6711)

## [3.3.1]
Expand Down
25 changes: 13 additions & 12 deletions FEATURE_GATES.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,19 @@ Features that reach GA and over time become stable will be removed from this tab

### Feature gates for Alpha or Beta features

| Feature | Default | Stage | Since | Until |
|----------------------------|---------|-------|--------|-------|
| GatewayAlpha | `false` | Alpha | 2.6.0 | TBD |
| FillIDs | `false` | Alpha | 2.10.0 | 3.0.0 |
| FillIDs | `true` | Beta | 3.0.0 | TBD |
| RewriteURIs | `false` | Alpha | 2.12.0 | TBD |
| KongServiceFacade | `false` | Alpha | 3.1.0 | TBD |
| SanitizeKonnectConfigDumps | `true` | Beta | 3.1.0 | TBD |
| FallbackConfiguration | `false` | Alpha | 3.2.0 | TBD |
| KongCustomEntity | `false` | Alpha | 3.2.0 | 3.3.0 |
| KongCustomEntity | `true` | Beta | 3.3.0 | TBD |

| Feature | Default | Stage | Since | Until |
|-----------------------------------------|---------|-------|--------|-------|
| GatewayAlpha | `false` | Alpha | 2.6.0 | TBD |
| FillIDs | `false` | Alpha | 2.10.0 | 3.0.0 |
| FillIDs | `true` | Beta | 3.0.0 | TBD |
| RewriteURIs | `false` | Alpha | 2.12.0 | TBD |
| KongServiceFacade | `false` | Alpha | 3.1.0 | TBD |
| SanitizeKonnectConfigDumps | `true` | Beta | 3.1.0 | TBD |
| FallbackConfiguration | `false` | Alpha | 3.2.0 | TBD |
| KongCustomEntity | `false` | Alpha | 3.2.0 | 3.3.0 |
| KongCustomEntity | `true` | Beta | 3.3.0 | TBD |
| CombinedServicesFromDifferentHTTPRoutes | `false` | Alpha | 3.4.0 | TBD |

**NOTE**: The `Gateway` feature gate refers to [Gateway
API](https://github.com/kubernetes-sigs/gateway-api) APIs which are in
`v1beta1` or later. `GatewayAlpha` refers to APIs which are still in alpha.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
_format_version: "3.0"
services:
- connect_timeout: 60000
host: httproute.default.svc.default.httpbin.80
id: 04198a15-6d25-58c6-b674-af66a0ef7341
name: httproute.default.svc.default.httpbin.80
host: httproute.default.httpbin.0
id: de4fffcc-97bc-59c6-9ccd-f1fb29b93beb
name: httproute.default.httpbin.0
port: 80
protocol: http
read_timeout: 60000
Expand Down Expand Up @@ -36,7 +36,7 @@ services:
upstreams:
- algorithm: round-robin
host_header: httpbin.org
name: httproute.default.svc.default.httpbin.80
name: httproute.default.httpbin.0
tags:
- k8s-name:httpbin
- k8s-namespace:default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
_format_version: "3.0"
services:
- connect_timeout: 60000
host: httproute.default.svc.default.httpbin.80.75_default.nginx.8080.25
id: 112d14cb-01c4-549a-aa72-1a4a234c0372
name: httproute.default.svc.default.httpbin.80.75_default.nginx.8080.25
host: httproute.default.httproute-testing.0
id: 4e3cb785-a8d0-5866-aa05-117f7c64f24d
name: httproute.default.httproute-testing.0
port: 8080
protocol: http
read_timeout: 60000
Expand Down Expand Up @@ -36,7 +36,7 @@ services:
write_timeout: 60000
upstreams:
- algorithm: round-robin
name: httproute.default.svc.default.httpbin.80.75_default.nginx.8080.25
name: httproute.default.httproute-testing.0
tags:
- k8s-name:httproute-testing
- k8s-namespace:default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
_format_version: "3.0"
services:
- connect_timeout: 60000
host: httproute.default.svc.default.httpbin.80.75_default.nginx.8080.25
id: 112d14cb-01c4-549a-aa72-1a4a234c0372
name: httproute.default.svc.default.httpbin.80.75_default.nginx.8080.25
host: httproute.default.httproute-testing.0
id: 4e3cb785-a8d0-5866-aa05-117f7c64f24d
name: httproute.default.httproute-testing.0
port: 8080
protocol: http
read_timeout: 60000
Expand Down Expand Up @@ -47,7 +47,7 @@ services:
write_timeout: 60000
upstreams:
- algorithm: round-robin
name: httproute.default.svc.default.httpbin.80.75_default.nginx.8080.25
name: httproute.default.httproute-testing.0
tags:
- k8s-name:httproute-testing
- k8s-namespace:default
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
_format_version: "3.0"
services:
- connect_timeout: 60000
host: httproute.default.svc.default.httpbin-prod.80.75_default.httpbin-test.80.25
id: b6fa5f0e-5164-504b-a000-3b568d82c8a1
name: httproute.default.svc.default.httpbin-prod.80.75_default.httpbin-test.80.25
host: httproute.default.httpbin.1
id: bbf738ea-19e7-5277-8a48-36d555e5ae94
name: httproute.default.httpbin.1
port: 80
protocol: http
read_timeout: 60000
retries: 5
routes:
- https_redirect_status_code: 426
id: 668cce91-3da3-590f-82c9-8296c5bb28e5
name: httproute.default.httpbin.0.0
id: e148326c-f112-5b0d-9644-4219ccb43cb6
name: httproute.default.httpbin.1.0
path_handling: v0
paths:
- ~/httpbin-with-test$
- /httpbin-with-test/
- ~/httpbin-prod-only$
- /httpbin-prod-only/
preserve_host: true
protocols:
- http
Expand All @@ -28,28 +28,27 @@ services:
- k8s-group:gateway.networking.k8s.io
- k8s-version:v1
tags:
- k8s-name:httpbin
- k8s-name:httpbin-prod
- k8s-namespace:default
- k8s-kind:HTTPRoute
- k8s-group:gateway.networking.k8s.io
- k8s-kind:Service
- k8s-version:v1
write_timeout: 60000
- connect_timeout: 60000
host: httproute.default.svc.default.httpbin-prod.80
id: a1a4f16c-ce16-57c7-8a4b-79789bdc9603
name: httproute.default.svc.default.httpbin-prod.80
host: httproute.default.httpbin.0
id: de4fffcc-97bc-59c6-9ccd-f1fb29b93beb
name: httproute.default.httpbin.0
port: 80
protocol: http
read_timeout: 60000
retries: 5
routes:
- https_redirect_status_code: 426
id: e148326c-f112-5b0d-9644-4219ccb43cb6
name: httproute.default.httpbin.1.0
id: 668cce91-3da3-590f-82c9-8296c5bb28e5
name: httproute.default.httpbin.0.0
path_handling: v0
paths:
- ~/httpbin-prod-only$
- /httpbin-prod-only/
- ~/httpbin-with-test$
- /httpbin-with-test/
preserve_host: true
protocols:
- http
Expand All @@ -62,9 +61,10 @@ services:
- k8s-group:gateway.networking.k8s.io
- k8s-version:v1
tags:
- k8s-name:httpbin-prod
- k8s-name:httpbin
- k8s-namespace:default
- k8s-kind:Service
- k8s-kind:HTTPRoute
- k8s-group:gateway.networking.k8s.io
- k8s-version:v1
write_timeout: 60000
upstreams:
Expand Down Expand Up @@ -104,13 +104,12 @@ upstreams:
unhealthy:
tcp_failures: 5
timeouts: 10
name: httproute.default.svc.default.httpbin-prod.80.75_default.httpbin-test.80.25
name: httproute.default.httpbin.1
slots: 100
tags:
- k8s-name:httpbin
- k8s-name:httpbin-prod
- k8s-namespace:default
- k8s-kind:HTTPRoute
- k8s-group:gateway.networking.k8s.io
- k8s-kind:Service
- k8s-version:v1
- algorithm: consistent-hashing
hash_fallback: consumer
Expand Down Expand Up @@ -148,10 +147,11 @@ upstreams:
unhealthy:
tcp_failures: 5
timeouts: 10
name: httproute.default.svc.default.httpbin-prod.80
name: httproute.default.httpbin.0
slots: 100
tags:
- k8s-name:httpbin-prod
- k8s-name:httpbin
- k8s-namespace:default
- k8s-kind:Service
- k8s-kind:HTTPRoute
- k8s-group:gateway.networking.k8s.io
- k8s-version:v1
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
_format_version: "3.0"
services:
- connect_timeout: 60000
host: httproute.default.svc.default.one.80.50_other.two.80.50
id: cb8be55b-3c05-50ab-9189-964d026b1312
name: httproute.default.svc.default.one.80.50_other.two.80.50
host: httproute.default.test.0
id: 5879d21c-33ed-5355-be10-f0911e04d397
name: httproute.default.test.0
port: 80
protocol: http
read_timeout: 60000
Expand Down Expand Up @@ -36,7 +36,7 @@ services:
write_timeout: 60000
upstreams:
- algorithm: round-robin
name: httproute.default.svc.default.one.80.50_other.two.80.50
name: httproute.default.test.0
tags:
- k8s-name:test
- k8s-namespace:default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ func TestBackendRefsToKongStateBackends(t *testing.T) {
}
}

func commonRouteSpecMock(parentReferentName string) gatewayapi.CommonRouteSpec {
func commonRouteSpecMock(parentReferentName string) gatewayapi.CommonRouteSpec { //nolint:unparam
return gatewayapi.CommonRouteSpec{
ParentRefs: []gatewayapi.ParentReference{{
Name: gatewayapi.ObjectName(parentReferentName),
Expand Down
Loading

0 comments on commit 80affc6

Please sign in to comment.