Skip to content

Commit

Permalink
deploy: log pod errors upon minikube setup timeout
Browse files Browse the repository at this point in the history
ensures any issues causing the timeout are captured and logged for easier debugging in github workflow

Signed-off-by: Tony Chen <[email protected]>
  • Loading branch information
Nahemah1022 committed Aug 7, 2024
1 parent 2fbc14f commit 0d437de
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions deploy/dev/k8s/minimal.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

source utils/ais_minikube_setup.sh

function handle_timeout() {
local pod_name=$1
echo "Timeout waiting for pod $pod_name to be ready. Retrieving logs..."
kubectl logs $pod_name
exit 1
}

# Default values and environment variables
export AIS_FS_PATHS=""
export TEST_FSPATH_COUNT=4
Expand Down Expand Up @@ -50,7 +57,7 @@ export AIS_LOG_DIR="/tmp/ais/${INSTANCE}/log"
envsubst < kube_templates/aisproxy_deployment.yml | kubectl apply -f -

echo "Waiting for the primary proxy to be ready..."
kubectl wait --for="condition=ready" --timeout=2m pod ais-proxy-0
kubectl wait --for="condition=ready" --timeout=2m pod $POD_NAME || handle_timeout $POD_NAME

echo "Starting target deployment..."

Expand All @@ -69,7 +76,7 @@ export AIS_LOG_DIR="/tmp/ais/${INSTANCE}/log"
envsubst < kube_templates/aistarget_deployment.yml | kubectl create -f -

echo "Waiting for the targets to be ready..."
kubectl wait --for="condition=ready" --timeout=2m pods -l type=aistarget
kubectl wait --for="condition=ready" --timeout=2m pods -l type=aistarget || handle_timeout $POD_NAME

# Display a list of running pods
echo "List of running pods"
Expand Down

0 comments on commit 0d437de

Please sign in to comment.