Skip to content

Commit 063cba7

Browse files
committed
feat: dedicated MaaS gateway
This PR updates manifests (and sample models) to use dedicate MaaS gateway instead of the default one used by KServe/LLMInferenceService. The segregated gateway approach ensures flexibility and isolation: - Existing ODH/KServe models remain unaffected - Models explicitly opt-in to MaaS features when ready - Traffic, resources, and policies are isolated for safer operations Signed-off-by: Bartosz Majsak <bartosz.majsak@gmail.com>
1 parent 60a69e3 commit 063cba7

File tree

17 files changed

+445
-44
lines changed

17 files changed

+445
-44
lines changed

deployment/README.md

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ kubectl -n kuadrant-system patch deployment kuadrant-operator-controller-manager
134134
Wait for Gateway to be ready:
135135

136136
```bash
137-
kubectl wait --for=condition=Programmed gateway openshift-ai-inference -n openshift-ingress --timeout=300s
137+
kubectl wait --for=condition=Programmed gateway maas-default-gateway -n openshift-ingress --timeout=300s
138138
```
139139

140140
Then restart Kuadrant operators:
@@ -159,17 +159,6 @@ kubectl patch csv kuadrant-operator.v0.0.0 -n kuadrant-system --type='json' -p='
159159
]'
160160
```
161161

162-
#### Update KServe Ingress Domain
163-
```bash
164-
kubectl -n kserve patch configmap inferenceservice-config \
165-
--type='json' \
166-
-p="[{
167-
\"op\": \"replace\",
168-
\"path\": \"/data/ingress\",
169-
\"value\": \"{\\\"enableGatewayApi\\\": true, \\\"kserveIngressGateway\\\": \\\"openshift-ingress/openshift-ai-inference\\\", \\\"ingressGateway\\\": \\\"istio-system/istio-ingressgateway\\\", \\\"ingressDomain\\\": \\\"$(kubectl get ingresses.config.openshift.io cluster -o jsonpath='{.spec.domain}')\\\"}\"
170-
}]"
171-
```
172-
173162
#### Update Limitador Image for Metrics (Optional but Recommended)
174163

175164
Update Limitador to expose metrics properly:
@@ -206,12 +195,12 @@ kubectl patch authpolicy maas-api-auth-policy -n maas-api \
206195

207196
For OpenShift:
208197
```bash
209-
HOST="$(kubectl get gateway openshift-ai-inference -n openshift-ingress -o jsonpath='{.status.addresses[0].value}')"
198+
HOST="$(kubectl get gateway maas-default-gateway -n openshift-ingress -o jsonpath='{.status.addresses[0].value}')"
210199
```
211200

212201
For Kubernetes with LoadBalancer:
213202
```bash
214-
HOST="$(kubectl get gateway openshift-ai-inference -n openshift-ingress -o jsonpath='{.status.addresses[0].value}')"
203+
HOST="$(kubectl get gateway maas-default-gateway -n openshift-ingress -o jsonpath='{.status.addresses[0].value}')"
215204
```
216205

217206
### 2. Get Authentication Token
@@ -276,7 +265,7 @@ kubectl get pods -n llm
276265
Check Gateway status:
277266

278267
```bash
279-
kubectl get gateway -n openshift-ingress openshift-ai-inference
268+
kubectl get gateway -n openshift-ingress maas-default-gateway
280269
```
281270

282271
Check that policies are enforced:

deployment/base/maas-api/networking/httproute.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
namespace: maas-api
66
spec:
77
parentRefs:
8-
- name: openshift-ai-inference
8+
- name: maas-default-gateway
99
namespace: openshift-ingress
1010
rules:
1111
- matches:

deployment/base/maas-api/policies/auth-policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ spec:
1616
kubernetesTokenReview:
1717
audiences:
1818
- https://kubernetes.default.svc
19-
- openshift-ai-inference-sa
19+
- maas-default-gateway-sa

deployment/base/networking/gateway-api.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ metadata:
66
spec:
77
controllerName: "openshift.io/gateway-controller/v1"
88
---
9+
# Default LLMInferenceService Gateway
910
apiVersion: gateway.networking.k8s.io/v1
1011
kind: Gateway
1112
metadata:
@@ -20,3 +21,23 @@ spec:
2021
allowedRoutes:
2122
namespaces:
2223
from: All
24+
---
25+
# Default MaaS Gateway for LLMInferenceServices - opt-in to MaaS features
26+
apiVersion: gateway.networking.k8s.io/v1
27+
kind: Gateway
28+
metadata:
29+
name: maas-default-gateway
30+
namespace: openshift-ingress
31+
labels:
32+
app.kubernetes.io/name: maas
33+
app.kubernetes.io/instance: maas-default-gateway
34+
app.kubernetes.io/component: gateway
35+
spec:
36+
gatewayClassName: openshift-default
37+
listeners:
38+
- name: http
39+
port: 80
40+
protocol: HTTP
41+
allowedRoutes:
42+
namespaces:
43+
from: All

deployment/base/policies/gateway-auth-policy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ spec:
88
targetRef:
99
group: gateway.networking.k8s.io
1010
kind: Gateway
11-
name: openshift-ai-inference
11+
name: maas-default-gateway
1212
rules:
1313
metadata:
1414
# Enriching identity metadata with a proper subscription tier based on user groups
@@ -29,7 +29,7 @@ spec:
2929
service-accounts:
3030
kubernetesTokenReview:
3131
audiences:
32-
- openshift-ai-inference-sa
32+
- maas-default-gateway-sa
3333
defaults:
3434
# token normalization - https://docs.kuadrant.io/1.2.x/authorino/docs/user-guides/token-normalization/
3535
# full username: system:serviceaccount:<ns>:<name>

deployment/base/policies/rate-limit-policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ spec:
77
targetRef:
88
group: gateway.networking.k8s.io
99
kind: Gateway
10-
name: openshift-ai-inference
10+
name: maas-default-gateway
1111
limits:
1212
free:
1313
rates:

deployment/base/policies/token-limit-policy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ spec:
1111
targetRef:
1212
group: gateway.networking.k8s.io
1313
kind: Gateway
14-
name: openshift-ai-inference
14+
name: maas-default-gateway
1515
limits:
1616
free-user-tokens:
1717
rates:

deployment/overlays/openshift/gateway-route.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ metadata:
1313
name: gateway-route
1414
namespace: openshift-ingress
1515
labels:
16-
app: openshift-ai-inference
17-
gateway: openshift-ai-inference
16+
app: maas
17+
gateway: maas-default-gateway
1818
spec:
1919
host: gateway.apps.test-maas-v1.eh5f.s1.devshift.org
2020
port:
@@ -24,6 +24,6 @@ spec:
2424
termination: edge
2525
to:
2626
kind: Service
27-
name: openshift-ai-inference-openshift-default
27+
name: maas-default-gateway-openshift-default
2828
weight: 100
2929
wildcardPolicy: None

deployment/scripts/deploy-openshift.sh

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -209,13 +209,6 @@ else
209209
echo " ✅ Kuadrant operator already configured"
210210
fi
211211

212-
# Update KServe Ingress Domain
213-
echo " Updating KServe configuration..."
214-
kubectl -n kserve patch configmap inferenceservice-config \
215-
--type='json' \
216-
-p="[{\"op\": \"replace\", \"path\": \"/data/ingress\", \"value\": \"{\\\"enableGatewayApi\\\": true, \\\"kserveIngressGateway\\\": \\\"openshift-ingress/openshift-ai-inference\\\", \\\"ingressGateway\\\": \\\"istio-system/istio-ingressgateway\\\", \\\"ingressDomain\\\": \\\"$CLUSTER_DOMAIN\\\"}\" }]" 2>/dev/null || \
217-
echo " KServe already configured"
218-
219212
echo ""
220213
echo "8️⃣ Waiting for Gateway to be ready..."
221214
echo " Note: This may take a few minutes if Service Mesh is being automatically installed..."
@@ -234,7 +227,7 @@ else
234227
fi
235228

236229
echo " Waiting for Gateway to become ready..."
237-
kubectl wait --for=condition=Programmed gateway openshift-ai-inference -n openshift-ingress --timeout=300s || \
230+
kubectl wait --for=condition=Programmed gateway maas-default-gateway -n openshift-ingress --timeout=300s || \
238231
echo " ⚠️ Gateway is taking longer than expected, continuing..."
239232

240233
echo ""
@@ -295,8 +288,8 @@ kubectl get pods -n opendatahub --no-headers | grep Running | wc -l | xargs echo
295288

296289
echo ""
297290
echo "Gateway Status:"
298-
kubectl get gateway -n openshift-ingress openshift-ai-inference -o jsonpath='{.status.conditions[?(@.type=="Accepted")].status}' | xargs echo " Accepted:"
299-
kubectl get gateway -n openshift-ingress openshift-ai-inference -o jsonpath='{.status.conditions[?(@.type=="Programmed")].status}' | xargs echo " Programmed:"
291+
kubectl get gateway -n openshift-ingress maas-default-gateway -o jsonpath='{.status.conditions[?(@.type=="Accepted")].status}' | xargs echo " Accepted:"
292+
kubectl get gateway -n openshift-ingress maas-default-gateway -o jsonpath='{.status.conditions[?(@.type=="Programmed")].status}' | xargs echo " Programmed:"
300293

301294
echo ""
302295
echo "Policy Status:"

0 commit comments

Comments
 (0)