mirror of
https://github.com/alibaba/higress.git
synced 2026-06-26 02:35:02 +08:00
fix: merge InferencePool route configs during HTTPRoute merge (#3964)
This commit is contained in:
@@ -14,6 +14,22 @@ metadata:
|
||||
spec: null
|
||||
status: {}
|
||||
---
|
||||
apiVersion: inference.networking.k8s.io/v1
|
||||
kind: InferencePool
|
||||
metadata:
|
||||
name: infpool-model1
|
||||
namespace: default
|
||||
spec: null
|
||||
status: {}
|
||||
---
|
||||
apiVersion: inference.networking.k8s.io/v1
|
||||
kind: InferencePool
|
||||
metadata:
|
||||
name: infpool-model2
|
||||
namespace: default
|
||||
spec: null
|
||||
status: {}
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||
kind: GatewayClass
|
||||
metadata:
|
||||
@@ -49,7 +65,7 @@ status:
|
||||
status: "True"
|
||||
type: Programmed
|
||||
listeners:
|
||||
- attachedRoutes: 11
|
||||
- attachedRoutes: 13
|
||||
conditions:
|
||||
- lastTransitionTime: fake
|
||||
message: No errors found
|
||||
@@ -272,6 +288,54 @@ status:
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: multi-route-infpool-1
|
||||
namespace: default
|
||||
spec: null
|
||||
status:
|
||||
parents:
|
||||
- conditions:
|
||||
- lastTransitionTime: fake
|
||||
message: Route was valid
|
||||
reason: Accepted
|
||||
status: "True"
|
||||
type: Accepted
|
||||
- lastTransitionTime: fake
|
||||
message: All references resolved
|
||||
reason: ResolvedRefs
|
||||
status: "True"
|
||||
type: ResolvedRefs
|
||||
controllerName: higress.io/gateway-controller
|
||||
parentRef:
|
||||
name: gateway
|
||||
namespace: higress-system
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: multi-route-infpool-2
|
||||
namespace: default
|
||||
spec: null
|
||||
status:
|
||||
parents:
|
||||
- conditions:
|
||||
- lastTransitionTime: fake
|
||||
message: Route was valid
|
||||
reason: Accepted
|
||||
status: "True"
|
||||
type: Accepted
|
||||
- lastTransitionTime: fake
|
||||
message: All references resolved
|
||||
reason: ResolvedRefs
|
||||
status: "True"
|
||||
type: ResolvedRefs
|
||||
controllerName: higress.io/gateway-controller
|
||||
parentRef:
|
||||
name: gateway
|
||||
namespace: higress-system
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: multiple-inferencepool-backend-refs
|
||||
namespace: default
|
||||
|
||||
@@ -421,3 +421,80 @@ spec:
|
||||
name: vllm-llama3-8b-instruct-epp
|
||||
port:
|
||||
number: 9002
|
||||
---
|
||||
# Test case for multiple HTTPRoutes with InferencePools on same gateway.
|
||||
# This verifies that InferencePool configs in Config.Extra are preserved when
|
||||
# the routes are merged into a single VirtualService.
|
||||
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: multi-route-infpool-1
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: gateway
|
||||
namespace: higress-system
|
||||
hostnames: ["multi-infpool.domain.example"]
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /model1
|
||||
backendRefs:
|
||||
- name: infpool-model1
|
||||
group: inference.networking.k8s.io
|
||||
kind: InferencePool
|
||||
port: 80
|
||||
---
|
||||
apiVersion: gateway.networking.k8s.io/v1beta1
|
||||
kind: HTTPRoute
|
||||
metadata:
|
||||
name: multi-route-infpool-2
|
||||
namespace: default
|
||||
spec:
|
||||
parentRefs:
|
||||
- name: gateway
|
||||
namespace: higress-system
|
||||
hostnames: ["multi-infpool.domain.example"]
|
||||
rules:
|
||||
- matches:
|
||||
- path:
|
||||
type: PathPrefix
|
||||
value: /model2
|
||||
backendRefs:
|
||||
- name: infpool-model2
|
||||
group: inference.networking.k8s.io
|
||||
kind: InferencePool
|
||||
port: 80
|
||||
---
|
||||
apiVersion: inference.networking.k8s.io/v1
|
||||
kind: InferencePool
|
||||
metadata:
|
||||
name: infpool-model1
|
||||
namespace: default
|
||||
spec:
|
||||
targetPorts:
|
||||
- number: 8000
|
||||
selector:
|
||||
matchLabels:
|
||||
app: model1-server
|
||||
endpointPickerRef:
|
||||
name: model1-epp
|
||||
port:
|
||||
number: 9002
|
||||
---
|
||||
apiVersion: inference.networking.k8s.io/v1
|
||||
kind: InferencePool
|
||||
metadata:
|
||||
name: infpool-model2
|
||||
namespace: default
|
||||
spec:
|
||||
targetPorts:
|
||||
- number: 8000
|
||||
selector:
|
||||
matchLabels:
|
||||
app: model2-server
|
||||
endpointPickerRef:
|
||||
name: model2-epp
|
||||
port:
|
||||
number: 9002
|
||||
|
||||
@@ -242,6 +242,35 @@ spec:
|
||||
---
|
||||
apiVersion: networking.istio.io/v1alpha3
|
||||
kind: VirtualService
|
||||
metadata:
|
||||
annotations:
|
||||
internal.istio.io/parents: HTTPRoute/multi-route-infpool-1.default,HTTPRoute/multi-route-infpool-2.default
|
||||
internal.istio.io/route-semantics: gateway
|
||||
name: higress-system~gateway-istio-autogenerated-k8s-gateway-default~multi-infpool.domain.example
|
||||
namespace: default
|
||||
spec:
|
||||
gateways:
|
||||
- higress-system/gateway-istio-autogenerated-k8s-gateway-default
|
||||
hosts:
|
||||
- multi-infpool.domain.example
|
||||
http:
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /model1
|
||||
name: default/multi-route-infpool-1
|
||||
route:
|
||||
- destination:
|
||||
host: infpool-model1-ip-aaaaf2d6.default.svc.domain.suffix
|
||||
- match:
|
||||
- uri:
|
||||
prefix: /model2
|
||||
name: default/multi-route-infpool-2
|
||||
route:
|
||||
- destination:
|
||||
host: infpool-model2-ip-f857bff9.default.svc.domain.suffix
|
||||
---
|
||||
apiVersion: networking.istio.io/v1alpha3
|
||||
kind: VirtualService
|
||||
metadata:
|
||||
annotations:
|
||||
internal.istio.io/parents: HTTPRoute/redirect-prefix-replace.default
|
||||
|
||||
Reference in New Issue
Block a user