theshire/.taskfiles/volsync/resources/wait-for-job.sh
Joseph Hanson d9ff973a55
moving to the shire
Expanding from 1 node to 6 + 2 VMs with GPUs
2024-09-04 13:35:14 -05:00

14 lines
365 B
Bash
Executable file

#!/usr/bin/env bash
JOB=$1
NAMESPACE="${2:-default}"
CLUSTER="${3:-main}"
[[ -z "${JOB}" ]] && echo "Job name not specified" && exit 1
while true; do
STATUS="$(kubectl --context "${CLUSTER}" -n "${NAMESPACE}" get pod -l job-name="${JOB}" -o jsonpath='{.items[*].status.phase}')"
if [ "${STATUS}" == "Pending" ]; then
break
fi
sleep 1
done