[feat] support Kubernetes Gateway API#6347
Open
eye-gu wants to merge 4 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Kubernetes Gateway API (gateway.networking.k8s.io/v1) support to ShenYu’s k8s controller/starter, alongside existing Ingress support, and introduces a new integrated test workflow to validate Gateway API routing.
Changes:
- Adds Spring Boot auto-configuration and controllers/reconcilers for
GatewayClass,Gateway, andHTTPRoute. - Implements
HttpRouteParser+GatewayRouteCacheto translate HTTPRoute specs into ShenYu selector/rule config and track bindings. - Introduces a new k8s Gateway API integrated test module and GitHub Actions workflow to run it on kind.
Reviewed changes
Copilot reviewed 26 out of 26 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| shenyu-spring-boot-starter/shenyu-spring-boot-starter-k8s/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports | Registers the new Gateway API auto-configuration. |
| shenyu-spring-boot-starter/shenyu-spring-boot-starter-k8s/src/main/resources/META-INF/spring.factories | Registers Gateway API auto-configuration for legacy Spring Boot loading. |
| shenyu-spring-boot-starter/shenyu-spring-boot-starter-k8s/src/main/java/org/apache/shenyu/springboot/starter/k8s/IngressControllerConfiguration.java | Adds shenyu.k8s.mode gating and fixes default secret TLS loading condition. |
| shenyu-spring-boot-starter/shenyu-spring-boot-starter-k8s/src/main/java/org/apache/shenyu/springboot/starter/k8s/GatewayApiControllerConfiguration.java | New Gateway API controller wiring (informers/controllers/reconcilers/repository bootstrap). |
| shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/reconciler/GatewayClassReconciler.java | New GatewayClass reconciliation + status patch + requeue logic. |
| shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/reconciler/GatewayReconciler.java | New Gateway reconciliation, status patching, and HTTPRoute requeueing. |
| shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/reconciler/HTTPRouteReconciler.java | New HTTPRoute reconciliation, config apply/delete, binding, and status patching. |
| shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/HttpRouteParser.java | New HTTPRoute→selector/rule translation logic. |
| shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/common/GatewayApiConstants.java | Gateway API constants + shared condition helper. |
| shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/cache/GatewayRouteCache.java | New thread-safe cache for route↔selector and gateway↔route bindings. |
| shenyu-kubernetes-controller/src/test/java/org/apache/shenyu/k8s/GatewayReconcilerTest.java | Unit tests for Gateway reconciliation behaviors. |
| shenyu-kubernetes-controller/src/test/java/org/apache/shenyu/k8s/HTTPRouteReconcilerTest.java | Unit tests for HTTPRoute reconciliation behaviors. |
| shenyu-kubernetes-controller/src/test/java/org/apache/shenyu/k8s/HttpRouteParserTest.java | Unit tests for HTTPRoute parsing/mapping logic. |
| shenyu-integrated-test/pom.xml | Adds the new Gateway API integrated test module to the build. |
| shenyu-integrated-test/shenyu-integrated-test-k8s-gateway-api-http/** | New integrated test module (app, config, Dockerfile, kind manifests, scripts, tests). |
| shenyu-examples/shenyu-examples-http/k8s/gateway-api.yml | Example GatewayClass/Gateway/HTTPRoute manifests for the HTTP example. |
| .github/workflows/integrated-test-k8s-gateway-api.yml | New CI workflow to run Gateway API integrated tests on kind. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
close #6346
Implements ShenYu support for Kubernetes Gateway API (gateway.networking.k8s.io/v1), complementing the existing Ingress support.
Core Components
GatewayClassReconcilerspec.controllerName=shenyuGatewayReconcilerHTTPRouteReconcilerHttpRouteParserHttpRouteParserSelectorData/RuleDataGatewayRouteCacheGatewayApiControllerConfigurationMake sure that:
./mvnw clean install -Dmaven.javadoc.skip=true.