Skip to content

Commit 17bbfb5

Browse files
committed
fix lint
Signed-off-by: Ryan Cook <rcook@redhat.com>
1 parent d1c4dc4 commit 17bbfb5

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

deploy/kserve/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,14 @@ INFERENCESERVICE_NAME=<your-inferenceservice-name>
103103

104104
# KServe creates a headless service by default (no stable ClusterIP)
105105
# Create a stable ClusterIP service for consistent routing
106+
107+
# Option 1: Using the template file (recommended)
108+
# Substitute variables and apply
109+
sed -e "s/{{INFERENCESERVICE_NAME}}/$INFERENCESERVICE_NAME/g" \
110+
-e "s/{{NAMESPACE}}/$NAMESPACE/g" \
111+
service-predictor-stable.yaml | oc apply -f - -n $NAMESPACE
112+
113+
# Option 2: Using heredoc
106114
cat <<EOF | oc apply -f - -n $NAMESPACE
107115
apiVersion: v1
108116
kind: Service

deploy/kserve/deploy.sh

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,14 @@ if [ "$SKIP_VALIDATION" = false ]; then
212212

213213
# Create stable ClusterIP service for predictor (KServe creates headless service by default)
214214
echo "Creating stable ClusterIP service for predictor..."
215-
cat <<EOF | oc apply -f - -n "$NAMESPACE" > /dev/null 2>&1
215+
216+
# Use template file for stable service
217+
if [ -f "$SCRIPT_DIR/service-predictor-stable.yaml" ]; then
218+
substitute_vars "$SCRIPT_DIR/service-predictor-stable.yaml" "$TEMP_DIR/service-predictor-stable.yaml.tmp"
219+
oc apply -f "$TEMP_DIR/service-predictor-stable.yaml.tmp" -n "$NAMESPACE" > /dev/null 2>&1
220+
else
221+
# Fallback to inline creation if template not found
222+
cat <<EOF | oc apply -f - -n "$NAMESPACE" > /dev/null 2>&1
216223
apiVersion: v1
217224
kind: Service
218225
metadata:
@@ -233,6 +240,7 @@ spec:
233240
targetPort: 8080
234241
protocol: TCP
235242
EOF
243+
fi
236244

237245
# Get the stable ClusterIP
238246
PREDICTOR_SERVICE_IP=$(oc get svc "${INFERENCESERVICE_NAME}-predictor-stable" -n "$NAMESPACE" -o jsonpath='{.spec.clusterIP}' 2>/dev/null || echo "")

deploy/kserve/service-predictor-stable.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
apiVersion: v1
44
kind: Service
55
metadata:
6-
name: {{INFERENCESERVICE_NAME}}-predictor-stable
7-
namespace: {{NAMESPACE}}
6+
name: "{{INFERENCESERVICE_NAME}}-predictor-stable"
7+
namespace: "{{NAMESPACE}}"
88
labels:
9-
app: {{INFERENCESERVICE_NAME}}
9+
app: "{{INFERENCESERVICE_NAME}}"
1010
component: predictor-stable
1111
annotations:
1212
description: "Stable ClusterIP service for semantic router to use (headless service doesn't provide ClusterIP)"
1313
spec:
1414
type: ClusterIP
1515
selector:
16-
serving.kserve.io/inferenceservice: {{INFERENCESERVICE_NAME}}
16+
serving.kserve.io/inferenceservice: "{{INFERENCESERVICE_NAME}}"
1717
ports:
1818
- name: http
1919
port: 8080

0 commit comments

Comments
 (0)