Skip to content

Commit b5a38f2

Browse files
author
Yuriy Bezsonov
committed
Add eks scripts to agent
1 parent 5e4348d commit b5a38f2

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

infrastructure/scripts/spring-ai/eks-agent-deploy.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,18 @@ kubectl rollout restart deployment unicorn-spring-ai-agent -n unicorn-spring-ai-
4040
echo "Waiting for pods to be ready..."
4141
kubectl rollout status deployment unicorn-spring-ai-agent -n unicorn-spring-ai-agent --timeout=300s
4242

43-
# Get the pod name
44-
POD_NAME=$(kubectl get pods -n unicorn-spring-ai-agent -l app=unicorn-spring-ai-agent -o jsonpath='{.items[0].metadata.name}')
43+
# Get the name of a running pod
44+
echo "Finding running pod..."
45+
POD_NAME=$(kubectl get pods -n unicorn-spring-ai-agent -l app=unicorn-spring-ai-agent --field-selector=status.phase=Running -o jsonpath='{.items[0].metadata.name}')
4546
if [ -z "$POD_NAME" ]; then
46-
echo "Error: Could not find pod. Exiting."
47-
exit 1
47+
echo "Error: Could not find running pod. Retrying with any pod status..."
48+
POD_NAME=$(kubectl get pods -n unicorn-spring-ai-agent -l app=unicorn-spring-ai-agent -o jsonpath='{.items[0].metadata.name}')
49+
if [ -z "$POD_NAME" ]; then
50+
echo "Error: Could not find any pod. Exiting."
51+
exit 1
52+
fi
4853
fi
54+
echo "Found pod: $POD_NAME"
4955

5056
# Show logs
5157
echo "Showing logs from pod $POD_NAME..."

infrastructure/scripts/spring-ai/eks-agent-setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ spec:
103103
initialDelaySeconds: 10
104104
startupProbe:
105105
httpGet:
106-
path: /
106+
path: /actuator/health
107107
port: 8080
108108
failureThreshold: 6
109109
periodSeconds: 5

0 commit comments

Comments
 (0)