Skip to content

Commit 37529e9

Browse files
authored
fix: add a workaround for 3.4ea2 to set runasuser in deployment (opendatahub-io#57)
Signed-off-by: Wen Zhou <wenzhou@redhat.com>
1 parent cf8a9b5 commit 37529e9

4 files changed

Lines changed: 14 additions & 2 deletions

File tree

charts/kserve/files/resources.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,7 @@ spec:
742742
runAsNonRoot: true
743743
seccompProfile:
744744
type: RuntimeDefault
745+
runAsUser: 1000
745746
serviceAccountName: llmisvc-controller-manager
746747
terminationGracePeriodSeconds: 30
747748
volumes:

charts/kserve/generate-chart.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,17 @@ yq eval 'select(.kind != "ValidatingWebhookConfiguration" and .kind != "Mutating
131131

132132
rm -f "${TEMP_BUILD}" "${FILES_DIR}/resources-all.yaml"
133133

134+
# Patch: add runAsUser to llmisvc-controller-manager deployment
135+
# UBI-based images don't set USER in Dockerfile, so non-OpenShift clusters
136+
# (which lack SCC to inject a UID) will fail the runAsNonRoot check without this.
137+
# TODO(RHOAIENG-56701): remove this patch once the image build sets USER 1000
138+
# https://redhat.atlassian.net/browse/RHOAIENG-56701
139+
echo "Patching llmisvc-controller-manager securityContext (runAsUser: 1000)..."
140+
yq eval '
141+
(select(.kind == "Deployment" and .metadata.name == "llmisvc-controller-manager")
142+
.spec.template.spec.securityContext.runAsUser) = 1000
143+
' -i "${FILES_DIR}/resources.yaml"
144+
134145
if [[ "${SKIP_IMAGE_REPLACEMENT}" == "true" ]]; then
135146
echo ""
136147
echo "Skipping image replacement (--skip-image-replacement flag set)"

helmfile.yaml.gotmpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ helmfiles:
5959
---
6060

6161
{{ $kserveChart := "oci://ghcr.io/opendatahub-io/kserve-rhaii-xks" }}
62-
{{ $kserveVersion := .Values.kserveChartVersion | default "3.4.0-ea.2" }}
62+
{{ $kserveVersion := .Values.kserveChartVersion | default "3.4.0-ea.2+cf8a9b5" }}
6363

6464
releases:
6565
- name: kserve-rhaii-xks

values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,4 @@ rhclOperator:
4040
# =============================================================================
4141

4242
# KServe OCI chart version (dev variant until official builds are on registry.redhat.io)
43-
kserveChartVersion: "3.4.0-ea.2"
43+
kserveChartVersion: "3.4.0-ea.2+cf8a9b5"

0 commit comments

Comments
 (0)