Skip to content

Commit fac0c8d

Browse files
authored
Merge pull request #76 from opendatahub-io/zhao-doc
docs: add operator-based deployment option for batch gateway
2 parents 4977c16 + f329691 commit fac0c8d

1 file changed

Lines changed: 95 additions & 4 deletions

File tree

docs/guides/deploy-rhoai.md

Lines changed: 95 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,10 @@ spec:
447447
rawDeploymentServiceConfig: Headed
448448
modelsAsService:
449449
managementState: Removed
450+
aigateway:
451+
managementState: Managed
452+
batchGateway:
453+
managementState: Managed
450454
dashboard:
451455
managementState: Removed
452456
EOF
@@ -870,10 +874,18 @@ EOF
870874
871875
</details>
872876

873-
Deploy batch-gateway with the model gateway URL pointing to the Internal Gateway:
877+
There are two ways to deploy the batch-gateway components. Choose **one** of the following sub-sections:
878+
879+
| | 3.9.1 LLMBatchGateway CR | 3.9.2 Helm chart |
880+
|---|---|---|
881+
| **Requires** | RHOAI with `aigateway` enabled ([3.5](#35-install-rhoai)) | `helm` CLI only |
882+
| **Image management** | Operator-pinned (from RHOAI release) | Manual (set per image) |
883+
| **Lifecycle** | Declarative CR, operator reconciles | Helm release |
884+
885+
Both options require the same dependencies (Redis, PostgreSQL, MinIO) and produce the same result.
874886

875887
<details>
876-
<summary>Create namespace and install dependencies</summary>
888+
<summary>Create namespace and install dependencies (required for both options)</summary>
877889

878890
```bash
879891
oc create namespace "${BATCH_NS}" 2>/dev/null || true
@@ -983,8 +995,87 @@ oc create secret generic batch-gateway-secrets \
983995
984996
</details>
985997

998+
#### 3.9.1 Option A: Deploy via LLMBatchGateway CR
999+
1000+
> **Prerequisite**: The DataScienceCluster must have `aigateway.managementState: Managed` with `aigateway.batchGateway.managementState: Managed` (see [3.5](#35-install-rhoai)). This deploys the ai-gateway-operator, which in turn deploys the batch-gateway-operator.
1001+
1002+
<details>
1003+
<summary>Create LLMBatchGateway CR</summary>
1004+
1005+
```bash
1006+
# Get model URL from the Internal Gateway service
1007+
INTERNAL_GW_SVC=$(oc get svc -n openshift-ingress \
1008+
-l "gateway.networking.k8s.io/gateway-name=batch-internal-gateway" \
1009+
-o jsonpath='{.items[0].metadata.name}')
1010+
MODEL_URL="http://${INTERNAL_GW_SVC}.openshift-ingress.svc.cluster.local/${LLM_NS}/${ISVC_NAME}"
1011+
1012+
oc apply -f - <<EOF
1013+
apiVersion: batch.llm-d.ai/v1alpha1
1014+
kind: LLMBatchGateway
1015+
metadata:
1016+
name: batch-gateway
1017+
namespace: ${BATCH_NS}
1018+
spec:
1019+
secretRef:
1020+
name: batch-gateway-secrets
1021+
dbBackend: postgresql
1022+
fileStorage:
1023+
s3:
1024+
region: us-east-1
1025+
endpoint: http://minio.${BATCH_NS}.svc.cluster.local:9000
1026+
accessKeyId: ${MINIO_USER}
1027+
prefix: ${MINIO_BUCKET}
1028+
usePathStyle: true
1029+
autoCreateBucket: true
1030+
apiServer:
1031+
replicas: 1
1032+
processor:
1033+
replicas: 1
1034+
globalInferenceGateway:
1035+
url: ${MODEL_URL}
1036+
requestTimeout: 5m
1037+
maxRetries: 3
1038+
initialBackoff: 1s
1039+
maxBackoff: 60s
1040+
config:
1041+
inferenceObjective: batch-sheddable
1042+
gc:
1043+
interval: 30m
1044+
tls:
1045+
enabled: true
1046+
certManager:
1047+
issuerName: selfsigned-issuer
1048+
issuerKind: ClusterIssuer
1049+
dnsNames:
1050+
- batch-gateway-apiserver
1051+
- batch-gateway-apiserver.${BATCH_NS}.svc.cluster.local
1052+
- localhost
1053+
EOF
1054+
1055+
# Wait for the batch gateway to be ready
1056+
oc wait llmbatchgateway/batch-gateway -n ${BATCH_NS} \
1057+
--for=condition=Ready --timeout=300s
1058+
```
1059+
1060+
> - **`processor.globalInferenceGateway.url`**: Points to the Internal Gateway's model endpoint. The Internal Gateway enforces AuthPolicy (model access check) but not TokenRateLimitPolicy.
1061+
> - **`processor.config.inferenceObjective`**: The `InferenceObjective` CRD name sent as the `x-gateway-inference-objective` header. EPP uses this to assign the request to the batch priority band (priority -1, sheddable).
1062+
> - **`tls.certManager`**: Enables TLS for the batch API server using cert-manager. In this demo the DestinationRule (see [3.10](#310-configure-httproute-and-policies-for-batch-gateway)) uses `insecureSkipVerify: true` because we use a self-signed certificate; in production, configure a trusted CA.
1063+
> - **Images**: The operator pins component images (apiserver, processor, gc) from its deployment configuration. You do not set image references in the CR.
1064+
> - **File storage**: This example uses S3-compatible storage (MinIO). To use a PVC instead, replace `fileStorage.s3` with:
1065+
> ```yaml
1066+
> fileStorage:
1067+
> fs:
1068+
> basePath: /tmp/batch-gateway
1069+
> claimName: batch-gateway-files
1070+
> ```
1071+
> The PVC must have `ReadWriteMany` access mode (requires NFS, CephFS, or similar).
1072+
1073+
</details>
1074+
1075+
#### 3.9.2 Option B: Deploy via Helm chart
1076+
9861077
<details>
987-
<summary>Install batch-gateway</summary>
1078+
<summary>Install batch-gateway with Helm</summary>
9881079
9891080
```bash
9901081
CHART_VERSION=0.2.0
@@ -1038,7 +1129,7 @@ helm upgrade --install batch-gateway \
10381129
> - **`modelGateways.<model>.url`**: The processor uses this URL to send inference requests. It points to the Internal Gateway's model endpoint (discovered from the Internal Gateway Service), not the external Gateway or the model server directly. The Internal Gateway enforces AuthPolicy (model access check) but not TokenRateLimitPolicy.
10391130
> - **`passThroughHeaders`**: Defaults to `[Authorization]`, so the processor forwards the end user's bearer token on inference calls without extra configuration. Override this only if you need a different set of headers.
10401131
>
1041-
> - **`apiserver.tls.certManager.*`**: Enables TLS for the batch API server using cert-manager. The `issuerName` must match a ClusterIssuer (e.g. `selfsigned-issuer`). The `dnsNames` should include the Service name and FQDN for TLS certificate generation. In this demo the DestinationRule (see 3.9) uses `insecureSkipVerify: true` because we use a self-signed certificate; in production, configure a trusted CA and set `insecureSkipVerify: false`.
1132+
> - **`apiserver.tls.certManager.*`**: Enables TLS for the batch API server using cert-manager. The `issuerName` must match a ClusterIssuer (e.g. `selfsigned-issuer`). The `dnsNames` should include the Service name and FQDN for TLS certificate generation. In this demo the DestinationRule (see 3.10) uses `insecureSkipVerify: true` because we use a self-signed certificate; in production, configure a trusted CA and set `insecureSkipVerify: false`.
10421133
> - **File storage**: This example uses S3-compatible storage (MinIO). To use a PVC instead, replace the `s3` options with:
10431134
> ```
10441135
> --set "global.fileClient.type=fs"

0 commit comments

Comments
 (0)