Skip to content

Commit 391883a

Browse files
committed
fix(catalog): enforce non-root security context on demo overlay initContainer
Apply upstream fix from kubeflow/hub#2568: add runAsNonRoot and runAsUser: 65534 (nobody) to the perf-data-init container. The base deployment enforces runAsNonRoot: true at pod level, but the demo overlay init container uses busybox (UID 0), producing Init:CreateContainerConfigError. Re-add catalog deployment and wait blocks to model_registry_install.sh. Signed-off-by: Siddhant Jain <siddhantjainofficial26@gmail.com>
1 parent f9c6031 commit 391883a

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

applications/model-registry/upstream/options/catalog/overlays/demo/kustomization.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ patches:
6464
- name: demo-perf-data
6565
mountPath: /demo-perf-data
6666
securityContext:
67+
runAsNonRoot: true
68+
runAsUser: 65534
6769
allowPrivilegeEscalation: false
6870
capabilities:
6971
drop:

tests/model_registry_install.sh

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,9 @@
11
#!/bin/bash
22
set -euxo pipefail
33

4-
# Install Model Registry server, UI, and database components
4+
# Install Model Registry server, UI, database, and catalog components
55
# This script can be used for local testing without GitHub Actions
66
# Usage: ./tests/model_registry_install.sh
7-
#
8-
# Note: Model Catalog (demo overlay) is NOT deployed in CI.
9-
# The demo overlay's perf-data-init container (busybox, UID 0) is incompatible
10-
# with the base deployment's runAsNonRoot: true security context. This is an
11-
# upstream issue. The catalog is an optional demo component not covered by the
12-
# integration tests in model_registry_test.sh, so deploying it in CI adds
13-
# zero test coverage and a known failure mode. It remains in
14-
# example/kustomization.yaml for user installations.
157

168
echo "Installing Model Registry components..."
179

@@ -30,6 +22,11 @@ echo "Deploying Model Registry UI..."
3022
kustomize build applications/model-registry/upstream/options/ui/overlays/istio \
3123
| kubectl apply -n kubeflow -f -
3224

25+
# Build and apply Model Catalog (demo overlay)
26+
echo "Deploying Model Catalog..."
27+
kustomize build applications/model-registry/upstream/options/catalog/overlays/demo \
28+
| kubectl apply -n kubeflow -f -
29+
3330
# Wait for Model Registry database deployment
3431
echo "Waiting for Model Registry database to become ready..."
3532
if ! kubectl wait --for=condition=available -n kubeflow deployment/model-registry-db --timeout=120s; then
@@ -60,6 +57,29 @@ if ! kubectl wait --for=condition=available -n kubeflow deployment/model-registr
6057
exit 1
6158
fi
6259

60+
# Wait for Model Catalog PostgreSQL StatefulSet
61+
echo "Waiting for Model Catalog database to become ready..."
62+
if ! kubectl wait --for=condition=ready -n kubeflow pod \
63+
-l app.kubernetes.io/name=postgres,app.kubernetes.io/part-of=model-catalog \
64+
--timeout=120s; then
65+
echo "ERROR: Model Catalog database pod failed"
66+
kubectl get pods -n kubeflow -l app.kubernetes.io/part-of=model-catalog
67+
kubectl describe statefulset/model-catalog-postgres -n kubeflow
68+
kubectl logs statefulset/model-catalog-postgres -n kubeflow
69+
exit 1
70+
fi
71+
72+
# Wait for Model Catalog server deployment
73+
echo "Waiting for Model Catalog server to become ready..."
74+
if ! kubectl wait --for=condition=available -n kubeflow deployment/model-catalog-server --timeout=120s; then
75+
echo "ERROR: Model Catalog server deployment failed"
76+
kubectl get pods -n kubeflow -l app.kubernetes.io/part-of=model-catalog
77+
kubectl describe deployment/model-catalog-server -n kubeflow
78+
kubectl logs deployment/model-catalog-server -n kubeflow --all-containers
79+
exit 1
80+
fi
81+
6382
echo "Model Registry installation complete!"
6483
kubectl get pods -n kubeflow -l component=model-registry-server
6584
kubectl get pods -n kubeflow -l app=model-registry-ui
85+
kubectl get pods -n kubeflow -l app.kubernetes.io/part-of=model-catalog

0 commit comments

Comments
 (0)