fix(e2e): run LB check curl from testing environment

Run curl directly from the testing container instead of creating
a separate pod with kubectl run. This avoids PodSecurity policy
violations and simplifies the test execution.

Co-Authored-By: Claude <noreply@anthropic.com>
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
This commit is contained in:
Andrei Kvapil 2026-01-02 21:02:06 +01:00
parent 5638a7eae9
commit dd0bbd375f
No known key found for this signature in database
GPG key ID: 931CF7FEACEAF765

View file

@ -202,20 +202,16 @@ if [ -z "$LB_ADDR" ]; then
exit 1
fi
kubectl run -n tenant-test lb-check-${test_name} \
--rm -i --restart=Never \
--image=curlimages/curl \
--timeout=60s \
--command -- \
sh -c "
for i in \$(seq 1 20); do
echo \"Attempt \$i\";
curl -sf http://${LB_ADDR} && exit 0;
sleep 3;
done;
echo 'LoadBalancer not reachable';
for i in $(seq 1 20); do
echo "Attempt $i"
curl --silent --fail "http://${LB_ADDR}" && break
sleep 3
done
if [ "$i" -eq 20 ]; then
echo "LoadBalancer not reachable" >&2
exit 1
"
fi
# Cleanup
kubectl delete deployment --kubeconfig tenantkubeconfig-${test_name} "${test_name}-backend" -n tenant-test