Skip to content

Commit

Permalink
PG evaluation for livenessProbe web container
Browse files Browse the repository at this point in the history
  • Loading branch information
Rub21 committed Oct 22, 2024
1 parent 686c7c0 commit 36f9725
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion osm-seed/templates/web/web-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,23 @@ spec:
command:
- /bin/bash
- -c
- ./liveness.sh
- >
# Check PostgreSQL connection
PGPASSWORD=$POSTGRES_PASSWORD psql -h $POSTGRES_HOST -U $POSTGRES_USER -d $POSTGRES_DB -c "SELECT 1;" > /dev/null 2>&1;
if [ $? -ne 0 ]; then
echo "Failed to connect to PostgreSQL";
exit 1;
fi;
# Check apache status
./liveness.sh;
if [ $? -ne 0 ]; then
echo "liveness.sh script failed";
exit 1;
fi;
echo "All checks passed";
exit 0;
initialDelaySeconds: 600
timeoutSeconds: 5
periodSeconds: 10
Expand Down

0 comments on commit 36f9725

Please sign in to comment.