Skip to content

Added provider support to InferencePool helm chart #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions config/charts/inferencepool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,14 @@ To install an InferencePool named `vllm-llama3-8b-instruct` that selects from e

```txt
$ helm install vllm-llama3-8b-instruct ./config/charts/inferencepool \
--set inferencePool.name=vllm-llama3-8b-instruct \
--set inferencePool.modelServers.matchLabels.app=vllm-llama3-8b-instruct \
--set inferencePool.targetPortNumber=8000
```

where `inferencePool.targetPortNumber` is the pod that vllm backends served on and `inferencePool.modelServers.matchLabels` is the selector to match the vllm backends.

To install via the latest published chart in staging (--version v0 indicates latest dev version), you can run the following command:

```txt
$ helm install vllm-llama3-8b-instruct \
--set inferencePool.name=vllm-llama3-8b-instruct \
--set inferencePool.modelServers.matchLabels.app=vllm-llama3-8b-instruct \
--set inferencePool.targetPortNumber=8000 \
oci://us-central1-docker.pkg.dev/k8s-staging-images/gateway-api-inference-extension/charts/inferencepool --version v0
```

Expand All @@ -38,17 +32,17 @@ $ helm uninstall pool-1

The following table list the configurable parameters of the chart.

| **Parameter Name** | **Description** |
|---------------------------------------------|-------------------------------------------------------------------------------------------------------------------|
| `inferencePool.name` | Name for the InferencePool, and inference extension will be named as `${inferencePool.name}-epp`. |
| `inferencePool.targetPortNumber` | Target port number for the vllm backends, will be used to scrape metrics by the inference extension. |
| `inferencePool.modelServers.matchLabels` | Label selector to match vllm backends managed by the inference pool. |
| `inferenceExtension.replicas` | Number of replicas for the inference extension service. Defaults to `1`. |
| `inferenceExtension.image.name` | Name of the container image used for the inference extension. |
| `inferenceExtension.image.hub` | Registry URL where the inference extension image is hosted. |
| `inferenceExtension.image.tag` | Image tag of the inference extension. |
| `inferenceExtension.image.pullPolicy` | Image pull policy for the container. Possible values: `Always`, `IfNotPresent`, or `Never`. Defaults to `Always`. |
| `inferenceExtension.extProcPort` | Port where the inference extension service is served for external processing. Defaults to `9002`. |
| **Parameter Name** | **Description** |
|---------------------------------------------|------------------------------------------------------------------------------------------------------------------------|
| `inferencePool.name` | Name for the InferencePool, and endpoint picker deployment and service will be named as `{.Release.name}-epp`. |
| `inferencePool.targetPortNumber` | Target port number for the vllm backends, will be used to scrape metrics by the inference extension. Defaults to 8000. |
| `inferencePool.modelServers.matchLabels` | Label selector to match vllm backends managed by the inference pool. |
| `inferenceExtension.replicas` | Number of replicas for the endpoint picker extension service. Defaults to `1`. |
| `inferenceExtension.image.name` | Name of the container image used for the endpoint picker. |
| `inferenceExtension.image.hub` | Registry URL where the endpoint picker image is hosted. |
| `inferenceExtension.image.tag` | Image tag of the endpoint picker. |
| `inferenceExtension.image.pullPolicy` | Image pull policy for the container. Possible values: `Always`, `IfNotPresent`, or `Never`. Defaults to `Always`. |
| `inferenceExtension.extProcPort` | Port where the endpoint picker service is served for external processing. Defaults to `9002`. |

## Notes

Expand Down
2 changes: 1 addition & 1 deletion config/charts/inferencepool/templates/NOTES.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
InferencePool {{ .Values.inferencePool.name }} deployed.
InferencePool {{ .Release.Name }} deployed.
4 changes: 2 additions & 2 deletions config/charts/inferencepool/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
Inference extension name
*/}}
{{- define "gateway-api-inference-extension.name" -}}
{{- $base := .Values.inferencePool.name | default "default-pool" | lower | trim | trunc 40 -}}
{{- $base := .Release.Name | default "default-pool" | lower | trim | trunc 40 -}}
{{ $base }}-epp
{{- end -}}

{{/*
Selector labels
*/}}
{{- define "gateway-api-inference-extension.selectorLabels" -}}
app: {{ include "gateway-api-inference-extension.name" . }}
inferencepool: {{ include "gateway-api-inference-extension.name" . }}
{{- end -}}
5 changes: 0 additions & 5 deletions config/charts/inferencepool/templates/_validations.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
common validations
*/}}
{{- define "gateway-api-inference-extension.validations.inferencepool.common" -}}
{{- if not $.Values.inferencePool.name }}
{{- fail "missing .Values.inferencePool.name" }}
{{- end }}


{{- if or (empty $.Values.inferencePool.modelServers) (not $.Values.inferencePool.modelServers.matchLabels) }}
{{- fail ".Values.inferencePool.modelServers.matchLabels is required" }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion config/charts/inferencepool/templates/epp-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
imagePullPolicy: {{ .Values.inferenceExtension.image.pullPolicy | default "Always" }}
args:
- -poolName
- {{ .Values.inferencePool.name }}
- {{ .Release.Name }}
- -poolNamespace
- {{ .Release.Namespace }}
- -v
Expand Down
59 changes: 59 additions & 0 deletions config/charts/inferencepool/templates/gke.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{{- if eq .Values.provider.name "gke" }}
---
kind: HealthCheckPolicy
apiVersion: networking.gke.io/v1
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gateway-api-inference-extension.labels" . | nindent 4 }}
spec:
targetRef:
group: "inference.networking.x-k8s.io"
kind: InferencePool
name: {{ .Release.Name }}
default:
config:
type: HTTP
httpHealthCheck:
requestPath: /health
port: {{ .Values.inferencePool.targetPortNumber }}
---
apiVersion: networking.gke.io/v1
kind: GCPBackendPolicy
metadata:
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gateway-api-inference-extension.labels" . | nindent 4 }}
spec:
targetRef:
group: "inference.networking.x-k8s.io"
kind: InferencePool
name: {{ .Release.Name }}
default:
timeoutSec: 300 # 5-minute timeout (adjust as needed)
---
apiVersion: monitoring.googleapis.com/v1
kind: ClusterPodMonitoring
metadata:
name: {{ .Release.Namespace }}-{{ .Release.Name }}
labels:
{{- include "gateway-api-inference-extension.labels" . | nindent 4 }}
spec:
endpoints:
- port: metrics
scheme: http
interval: 5s
path: /metrics
authorization:
type: Bearer
credentials:
secret:
name: {{ .Values.gke.monitoringSecret }}
key: token
namespace: {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "gateway-api-inference-extension.labels" . | nindent 8 }}
{{- end }}
2 changes: 1 addition & 1 deletion config/charts/inferencepool/templates/inferencepool.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: inference.networking.x-k8s.io/v1alpha2
kind: InferencePool
metadata:
name: {{ .Values.inferencePool.name }}
name: {{ .Release.Name }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "gateway-api-inference-extension.labels" . | nindent 4 }}
Expand Down
7 changes: 6 additions & 1 deletion config/charts/inferencepool/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@ inferenceExtension:
extProcPort: 9002

inferencePool:
# name: pool-1 # REQUIRED
targetPortNumber: 8000
# modelServers: # REQUIRED
# matchLabels:
# app: vllm-llama3-8b-instruct

provider:
name: none

gke:
monitoringSecret: inference-gateway-sa-metrics-reader-secret