File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,12 @@ kubectl create namespace ${NAMESPACE} 2>/dev/null || true
97
97
# Hack to deal with KGateways broken OpenShift support
98
98
export PROXY_UID=$( kubectl get namespace ${NAMESPACE} -o json | jq -e -r ' .metadata.annotations["openshift.io/sa.scc.uid-range"]' | perl -F' /' -lane ' print $F[0]+1' ) ;
99
99
100
+ # Detect if the cluster is OpenShift by checking for the 'route.openshift.io' API group
101
+ IS_OPENSHIFT=false
102
+ if kubectl api-resources 2> /dev/null | grep -q ' route.openshift.io' ; then
103
+ IS_OPENSHIFT=true
104
+ fi
105
+
100
106
set -o pipefail
101
107
102
108
if [[ " $CLEAN " == " true" ]]; then
@@ -105,7 +111,14 @@ if [[ "$CLEAN" == "true" ]]; then
105
111
kustomize build deploy/environments/dev/kubernetes-vllm/${VLLM_MODE} | envsubst | kubectl -n " ${NAMESPACE} " delete --ignore-not-found=true -f -
106
112
else
107
113
echo " INFO: Deploying vLLM Environment in namespace ${NAMESPACE} "
108
- oc adm policy add-scc-to-user anyuid -z default -n ${NAMESPACE}
114
+ if [[ " ${IS_OPENSHIFT} " == " true" ]]; then
115
+ if command -v oc & > /dev/null; then
116
+ # Grant the 'default' service account permission to run containers as any user (disables UID restrictions)
117
+ oc adm policy add-scc-to-user anyuid -z default -n " ${NAMESPACE} "
118
+ echo " INFO: OpenShift cluster detected – granted 'anyuid' SCC to the 'default' service account in namespace '${NAMESPACE} '."
119
+ fi
120
+ fi
121
+
109
122
kustomize build deploy/environments/dev/kubernetes-vllm/${VLLM_MODE} | envsubst | kubectl -n " ${NAMESPACE} " apply -f -
110
123
111
124
echo " INFO: Deploying Gateway Environment in namespace ${NAMESPACE} "
You can’t perform that action at this time.
0 commit comments