Skip to content

[feat] support Kubernetes Gateway API#6347

Open
eye-gu wants to merge 4 commits into
apache:masterfrom
eye-gu:fix-6346
Open

[feat] support Kubernetes Gateway API#6347
eye-gu wants to merge 4 commits into
apache:masterfrom
eye-gu:fix-6346

Conversation

@eye-gu
Copy link
Copy Markdown
Contributor

@eye-gu eye-gu commented May 18, 2026

close #6346

Implements ShenYu support for Kubernetes Gateway API (gateway.networking.k8s.io/v1), complementing the existing Ingress support.

Core Components

Component Description
GatewayClassReconciler Watches GatewayClass, accepts those with spec.controllerName=shenyu
GatewayReconciler Watches Gateway, re-queues affected HTTPRoutes on Gateway changes
HTTPRouteReconciler Watches HTTPRoute, parses into ShenYu selector/rule via HttpRouteParser
HttpRouteParser Translates HTTPRoute spec (hostnames + matches + backendRefs) into SelectorData/RuleData
GatewayRouteCache Thread-safe cache for route↔selector and gateway↔route bindings
GatewayApiControllerConfiguration Spring Boot auto-configuration for all Gateway API beans

Make sure that:

  • You have read the contribution guidelines.
  • You submit test cases (unit or integration tests) that back your changes.
  • Your local test passed ./mvnw clean install -Dmaven.javadoc.skip=true.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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, and HTTPRoute.
  • Implements HttpRouteParser + GatewayRouteCache to 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Support Kubernetes Gateway API

2 participants