Skip to content

Commit 26d7106

Browse files
authored
feat(standalone): align agentgateway configuration with upstream GAIE PR 2905 (#1600)
* fix(standalone): rework agentgateway configuration to use derived pseudo-service Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com> * chore: trigger ci re-run Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com> * fix(standalone): update agentgateway validation error and add verification assertions Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com> --------- Signed-off-by: abhay1999 <abhaychaurasiya19@gmail.com>
1 parent 2253a35 commit 26d7106

6 files changed

Lines changed: 47 additions & 129 deletions

File tree

config/charts/README.md

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,14 @@ helm install my-standalone-router ./config/charts/llm-d-router-standalone \
3232
--set router.modelServers.matchLabels.app=my-vllm-service
3333
```
3434

35-
#### Standalone with Agentgateway Proxy (Service-Backed)
36-
Deploys EPP with an Agentgateway proxy. This mode requires disabling the `InferencePool` resource creation (`create=false`) and routes traffic to an existing Kubernetes Service:
35+
#### Standalone with Agentgateway Proxy
36+
Deploys EPP with an Agentgateway proxy. This mode requires disabling the `InferencePool` resource creation (`create=false`) and routes traffic directly to model servers:
3737

3838
```bash
3939
helm install my-standalone-router ./config/charts/llm-d-router-standalone \
4040
--set router.inferencePool.create=false \
4141
--set router.proxy.proxyType=agentgateway \
42-
--set router.proxy.agentgateway.service.name=my-model-service \
43-
--set router.proxy.agentgateway.service.ports="8000"
42+
--set router.modelServers.matchLabels.app=my-model-service
4443
```
4544

4645
#### Standalone with a Separate Proxy Service
@@ -538,20 +537,21 @@ Configures EPP to run with a proxy (Envoy proxy or Agentgateway proxy) that inte
538537
| `router.proxy.volumeMounts` | Sidecar container volume mounts. | `[]` |
539538
| `router.proxy.volumes` | Sidecar container volumes. | `[]` |
540539
| `router.proxy.configMapData` | Key-value pairs to include in a ConfigMap created for the sidecar. | `{}` |
541-
| `router.proxy.agentgateway.service.create` | **Agentgateway only**. Create a dedicated model Service for the Agentgateway proxy. | `true` |
542-
| `router.proxy.agentgateway.service.name` | **Agentgateway only**. Name of the model Service to route to. | `""` |
543-
| `router.proxy.agentgateway.service.namespace` | **Agentgateway only**. Namespace of the model Service. Defaults to release namespace. | `""` |
544-
| `router.proxy.agentgateway.service.ports` | **Agentgateway only**. Port list for the model Service (must match `modelServers.targetPorts`). | `[]` |
540+
#### Complete Standalone Example with Agentgateway Proxy
545541

546-
#### Complete Proxy Sidecar Example (Agentgateway Service-Backed)
547-
548-
To deploy EPP in standalone mode with an Agentgateway sidecar routing traffic directly to an existing model Service `my-model-service` (bypassing `InferencePool` creation):
542+
To deploy EPP in standalone mode with an Agentgateway sidecar routing traffic directly to model servers matching the label `app=my-model-service` (bypassing `InferencePool` creation):
549543

550544
```yaml
551545
router:
552546
inferencePool:
553547
create: false # Disable InferencePool creation
554548
549+
modelServers:
550+
matchLabels:
551+
app: "my-model-service"
552+
targetPorts:
553+
- number: 8000
554+
555555
proxy:
556556
enabled: true
557557
proxyType: agentgateway
@@ -561,10 +561,4 @@ router:
561561
memory: 4Gi
562562
limits:
563563
memory: 8Gi
564-
agentgateway:
565-
service:
566-
create: true # Create a Service to route client traffic to EPP
567-
name: "my-model-service"
568-
ports:
569-
- 8000 # Intercept traffic on port 8000
570564
```

config/charts/llm-d-router-standalone/templates/_validations.tpl

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,32 +53,17 @@ standalone validations
5353
{{- fail (printf ".Values.router.proxy.proxyType must be one of [envoy, agentgateway], got %q" $proxyType) -}}
5454
{{- end -}}
5555
{{- if eq $proxyType "agentgateway" -}}
56+
{{- if hasKey $proxy "agentgateway" -}}
57+
{{- fail ".Values.router.proxy.agentgateway is no longer supported; standalone agentgateway uses EPP endpoint discovery with a logical service backend" -}}
58+
{{- end -}}
5659
{{- if ne .Values.router.inferencePool.create false -}}
5760
{{- fail ".Values.router.inferencePool.create=false is required when proxyType=agentgateway; standalone agentgateway currently supports only service-backed routing" -}}
5861
{{- end -}}
59-
{{- $agentgateway := index $proxy "agentgateway" | default dict -}}
60-
{{- $service := index $agentgateway "service" | default dict -}}
61-
{{- $serviceName := index $service "name" | default "" -}}
62-
{{- $serviceCreate := index $service "create" | default true -}}
63-
{{- if hasKey $service "port" -}}
64-
{{- fail ".Values.router.proxy.agentgateway.service.port has been replaced by .Values.router.proxy.agentgateway.service.ports" -}}
65-
{{- end -}}
66-
{{- if empty $serviceName -}}
67-
{{- fail ".Values.router.proxy.agentgateway.service.name is required when proxyType=agentgateway" -}}
68-
{{- end -}}
69-
{{- $targetPorts := include "llm-d-router.standaloneEndpointTargetPorts" . -}}
70-
{{- $servicePorts := include "llm-d-router.agentgateway.modelServicePorts" . -}}
71-
{{- if ne $targetPorts $servicePorts -}}
72-
{{- fail (printf ".Values.router.proxy.agentgateway.service.ports must match .Values.router.modelServers.targetPorts when proxyType=agentgateway, got service ports %q and target ports %q" $servicePorts $targetPorts) -}}
73-
{{- end -}}
7462
{{- $listenerPort := include "llm-d-router.standaloneProxyListenerPort" . -}}
7563
{{- $flags := .Values.router.epp.flags | default dict -}}
7664
{{- if and (hasKey $flags "secure-serving") (ne (toString (index $flags "secure-serving")) "false") -}}
7765
{{- fail ".Values.router.epp.flags.secure-serving must be false when proxyType=agentgateway; standalone agentgateway uses plaintext gRPC to EPP over localhost" -}}
7866
{{- end -}}
79-
{{- if $serviceCreate -}}
80-
{{- $selectorLabels := include "llm-d-router.agentgateway.modelServiceSelectorLabels" . -}}
81-
{{- end -}}
8267
{{- end -}}
8368
{{- end -}}
8469
{{- end -}}

config/charts/llm-d-router-standalone/templates/agentgateway-service.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

config/charts/llm-d-router-standalone/values.yaml

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,7 @@ router:
3333
limits:
3434
memory: 16Gi
3535

36-
# Agentgateway-specific settings used by the built-in preset when
37-
# proxyType=agentgateway. service.name is required.
38-
agentgateway:
39-
service:
40-
create: true
41-
name: ""
42-
namespace: ""
43-
# Must match inferencePool.targetPorts.
44-
ports:
45-
- 8000
36+
4637

4738
# Built-in standalone proxy presets. The selected preset is merged with the
4839
# top-level proxy.* fields below, so explicit user overrides still win.

config/charts/routerlib/templates/_helpers.tpl

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -269,13 +269,20 @@ Return the standalone EPP model-server target ports.
269269
{{- end -}}
270270

271271
{{/*
272-
Return the agentgateway model Service ports.
272+
Return the agentgateway standalone logical backend service name.
273+
Derives the name from .Values.router.modelServers.matchLabels.app,
274+
falling back to .Release.Name if not set.
273275
*/}}
274-
{{- define "llm-d-router.agentgateway.modelServicePorts" -}}
275-
{{- $proxyValues := .Values.router.proxy | default dict -}}
276-
{{- $agentgateway := index $proxyValues "agentgateway" | default dict -}}
277-
{{- $service := index $agentgateway "service" | default dict -}}
278-
{{- include "llm-d-router.normalizedPortList" (dict "path" ".Values.router.proxy.agentgateway.service.ports" "value" (index $service "ports")) -}}
276+
{{- define "llm-d-router.agentgateway.logicalBackendName" -}}
277+
{{- $appLabel := "" -}}
278+
{{- if and .Values.router.modelServers .Values.router.modelServers.matchLabels -}}
279+
{{- $appLabel = index .Values.router.modelServers.matchLabels "app" | default "" -}}
280+
{{- end -}}
281+
{{- if not (empty $appLabel) -}}
282+
{{- $appLabel -}}
283+
{{- else -}}
284+
{{- .Release.Name -}}
285+
{{- end -}}
279286
{{- end -}}
280287

281288
{{/*
@@ -329,30 +336,15 @@ Return the rendered proxy ConfigMap data.
329336
{{- toYaml $data -}}
330337
{{- end -}}
331338

332-
{{/*
333-
Render labels from the standalone endpoint selector for the generated model Service.
334-
Only equality-based selectors are supported because Service selectors are a map.
335-
*/}}
336-
{{- define "llm-d-router.agentgateway.modelServiceSelectorLabels" -}}
337-
{{- if and .Values.router.modelServers .Values.router.modelServers.matchLabels -}}
338-
{{- range $key, $value := .Values.router.modelServers.matchLabels -}}
339-
{{- printf "%s: %s\n" ($key | quote) ($value | quote) -}}
340-
{{- end -}}
341-
{{- else -}}
342-
{{- fail ".Values.modelServers.matchLabels is required when creating an agentgateway model Service" -}}
343-
{{- end -}}
344-
{{- end -}}
339+
345340

346341
{{/*
347342
Render the default standalone agentgateway proxy config template.
348343
*/}}
349344
{{- define "llm-d-router.proxy.agentgatewayConfig" -}}
350-
{{- $proxyValues := .Values.router.proxy | default dict -}}
351-
{{- $agentgateway := index $proxyValues "agentgateway" | default dict -}}
352-
{{- $service := index $agentgateway "service" | default dict -}}
353-
{{- $serviceName := index $service "name" | default "" -}}
354-
{{- $serviceNamespace := index $service "namespace" | default .Release.Namespace -}}
355-
{{- $servicePorts := splitList "," (include "llm-d-router.agentgateway.modelServicePorts" .) -}}
345+
{{- $serviceName := include "llm-d-router.agentgateway.logicalBackendName" . -}}
346+
{{- $serviceNamespace := .Release.Namespace -}}
347+
{{- $servicePorts := splitList "," (include "llm-d-router.standaloneEndpointTargetPorts" .) -}}
356348
{{- $backendPort := index $servicePorts 0 -}}
357349
{{- $listenerPort := include "llm-d-router.standaloneProxyListenerPort" . | int -}}
358350
config:

0 commit comments

Comments
 (0)