Skip to content

Commit 7eb291a

Browse files
fix: replace ClusterRoleBinding to view with namespace-scoped pods permission (#310)
The test-requester binary's getPodUIDs() lists pods in the test namespace to sweep stale GPU allocations. This permission was previously supplied via a ClusterRoleBinding to the built-in view ClusterRole, which is a cluster-scoped object requiring cluster-admin privileges and preventing concurrent test runs. Replace it with an explicit get/list/watch rule on pods added to the existing namespace-scoped testreq Role. Remove all creation and cleanup of the testreq-view ClusterRoleBinding from every test script and the OpenShift CI workflow. Fixes #309 (sub-issue of #276). Signed-off-by: Mike Spreitzer <mspreitz@us.ibm.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 0f70f3e commit 7eb291a

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

.github/workflows/ci-e2e-openshift.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,9 @@ jobs:
588588
- apiGroups: [""]
589589
resources: ["configmaps"]
590590
verbs: ["create"]
591+
- apiGroups: [""]
592+
resources: ["pods"]
593+
verbs: ["get", "list", "watch"]
591594
EOF
592595
593596
kubectl create sa testreq -n "$FMA_NAMESPACE" || true
@@ -596,8 +599,6 @@ jobs:
596599
kubectl create rolebinding testreq \
597600
--role=testreq --serviceaccount="${FMA_NAMESPACE}:testreq" \
598601
-n "$FMA_NAMESPACE" || true
599-
kubectl create clusterrolebinding "testreq-view-${FMA_NAMESPACE}" \
600-
--clusterrole=view --serviceaccount="${FMA_NAMESPACE}:testreq" || true
601602
602603
echo "Test RBAC created"
603604
@@ -923,7 +924,6 @@ jobs:
923924
# Delete cluster-scoped resources
924925
kubectl delete clusterrole fma-node-viewer --ignore-not-found || true
925926
kubectl delete clusterrolebinding "$FMA_RELEASE_NAME-node-view" --ignore-not-found || true
926-
kubectl delete clusterrolebinding "testreq-view-${FMA_NAMESPACE}" --ignore-not-found || true
927927
928928
echo "Cleanup complete"
929929

inference_server/benchmark/setup_kind_resources.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,17 @@ rules:
5959
- configmaps
6060
verbs:
6161
- create
62+
- apiGroups:
63+
- ""
64+
resources:
65+
- pods
66+
verbs:
67+
- get
68+
- list
69+
- watch
6270
EOF
6371

6472
kubectl create rolebinding testreq --role=testreq --serviceaccount=$(kubectl get sa default -o jsonpath={.metadata.namespace}):testreq
65-
kubectl create clusterrolebinding testreq-view --clusterrole=view --serviceaccount=$(kubectl get sa default -o jsonpath={.metadata.namespace}):testreq
6673

6774
kubectl create sa testreq
6875
kubectl create cm gpu-map

test/e2e/run-launcher-based.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,17 @@ rules:
108108
- configmaps
109109
verbs:
110110
- create
111+
- apiGroups:
112+
- ""
113+
resources:
114+
- pods
115+
verbs:
116+
- get
117+
- list
118+
- watch
111119
EOF
112120

113121
kubectl create rolebinding testreq --role=testreq --serviceaccount=$(kubectl get sa default -o jsonpath={.metadata.namespace}):testreq
114-
kubectl create clusterrolebinding testreq-view --clusterrole=view --serviceaccount=$(kubectl get sa default -o jsonpath={.metadata.namespace}):testreq
115122

116123
kubectl create sa testreq
117124
kubectl create cm gpu-map

test/e2e/run.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,17 @@ rules:
104104
- configmaps
105105
verbs:
106106
- create
107+
- apiGroups:
108+
- ""
109+
resources:
110+
- pods
111+
verbs:
112+
- get
113+
- list
114+
- watch
107115
EOF
108116

109117
kubectl create rolebinding testreq --role=testreq --serviceaccount=$(kubectl get sa default -o jsonpath={.metadata.namespace}):testreq
110-
kubectl create clusterrolebinding testreq-view --clusterrole=view --serviceaccount=$(kubectl get sa default -o jsonpath={.metadata.namespace}):testreq
111118

112119

113120
kubectl create sa testreq

0 commit comments

Comments
 (0)