@@ -154,25 +154,54 @@ jobs:
154154 kubectl get pods
155155 kubectl get services
156156
157- echo "Waiting for Memgraph pod to be ready (may take up to 5 minutes)..."
158- if ! kubectl wait --for=condition=ready pod -l app=memgraph --timeout=5m; then
157+ echo "Waiting for Memgraph pod to be ready (may take up to 10 minutes)..."
158+ # First, check if there are any existing failed pods and delete them
159+ FAILED_PODS=$(kubectl get pods -l app=memgraph -o jsonpath="{.items[?(@.status.phase=='Failed' || @.status.containerStatuses[0].state.waiting.reason=='CrashLoopBackOff')].metadata.name}")
160+ if [[ -n "$FAILED_PODS" ]]; then
161+ echo "Found failed pods, cleaning up before proceeding:"
162+ echo "$FAILED_PODS" | tr ' ' '\n' | while read pod; do
163+ echo "Deleting failed pod: $pod"
164+ kubectl delete pod $pod
165+ done
166+ echo "Waiting for cleanup to complete..."
167+ sleep 30
168+ fi
169+
170+ # Wait for pod to be ready with increased timeout and check interval
171+ if ! kubectl wait --for=condition=ready pod -l app=memgraph --timeout=10m; then
159172 echo "Error: Memgraph pod did not become ready within the timeout period."
160173 echo "Checking Memgraph pod logs:"
161174 POD_NAME=$(kubectl get pods -l app=memgraph -o jsonpath="{.items[0].metadata.name}")
162- kubectl logs $POD_NAME
175+
176+ echo "Pod details:"
163177 kubectl describe pod $POD_NAME
164- echo "Deployment verification failed!"
178+
179+ echo "Pod logs:"
180+ kubectl logs $POD_NAME --tail=100
181+
182+ echo "Checking node resource utilization:"
183+ kubectl describe nodes
184+
185+ echo "Deployment verification failed! Please check the Kubernetes cluster's resources and capacity."
165186 exit 1
166187 fi
167188
168189 echo "Memgraph deployment successful!"
169190
170191 # Wait for the LoadBalancer service to get an external IP
171192 echo "Waiting for LoadBalancer to get external IP..."
172- for i in {1..30 }; do
193+ for i in {1..45 }; do
173194 EXTERNAL_IP=$(kubectl get service memgraph -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
174195 if [[ -n "$EXTERNAL_IP" ]]; then
175196 echo "Memgraph is accessible at: ${EXTERNAL_IP}:7687"
197+
198+ # Add a simple connectivity check
199+ echo "Performing basic connectivity test..."
200+ if nc -z -w 5 ${EXTERNAL_IP} 7687; then
201+ echo "Successfully connected to Memgraph on port 7687!"
202+ else
203+ echo "Warning: Could not connect to Memgraph on port 7687. The service may not be fully ready yet."
204+ fi
176205 break
177206 fi
178207 echo "Waiting for external IP (attempt $i)..."
@@ -181,4 +210,6 @@ jobs:
181210
182211 if [[ -z "$EXTERNAL_IP" ]]; then
183212 echo "Warning: Could not obtain external IP for Memgraph service within timeout."
213+ echo "Checking LoadBalancer service status:"
214+ kubectl describe service memgraph
184215 fi
0 commit comments