mirror of
https://github.com/auricom/home-cluster.git
synced 2025-10-02 08:47:17 +02:00
feat: overhaul
This commit is contained in:
21
.taskfiles/volsync/scripts/controller.sh
Executable file
21
.taskfiles/volsync/scripts/controller.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
APP=$1
|
||||
NAMESPACE="${2:-default}"
|
||||
|
||||
is_deployment() {
|
||||
kubectl -n "${NAMESPACE}" get deployment "${APP}" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
is_statefulset() {
|
||||
kubectl -n "${NAMESPACE}" get statefulset "${APP}" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
if is_deployment; then
|
||||
echo "deployment.apps/${APP}"
|
||||
elif is_statefulset; then
|
||||
echo "statefulset.apps/${APP}"
|
||||
else
|
||||
echo "No deployment or statefulset found for ${APP}"
|
||||
exit 1
|
||||
fi
|
14
.taskfiles/volsync/scripts/wait.sh
Executable file
14
.taskfiles/volsync/scripts/wait.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/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 -n "${NAMESPACE}" get pod -l job-name="${JOB}" -o jsonpath='{.items[*].status.phase}')"
|
||||
if [ "${STATUS}" == "Pending" ]; then
|
||||
break
|
||||
fi
|
||||
sleep 1
|
||||
done
|
Reference in New Issue
Block a user