Skip to content

Commit ace6d05

Browse files
committed
Enhance Kubernetes workflow with error pod checks and update load-graphql image
- Added checks for failed or error pods in the Kubernetes workflow, providing logs for troubleshooting. -image: debian:buster is end of life. Updated the load-graphql job to use the debian:bullseye image for improved compatibility.
1 parent 46e2405 commit ace6d05

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/docker-k8s.yml

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,6 @@ jobs:
8282
make kustomize-local-apply
8383
echo "=== Verifying job creation ==="
8484
kubectl get jobs -n pokeapi
85-
echo "=== Checking if load-graphql job exists ==="
86-
kubectl get job load-graphql -n pokeapi || echo "Job not found - this is the problem!"
8785
kubectl proxy &
8886
sleep 1
8987
bash Resources/scripts/wait.sh http://localhost:8001/api/v1/namespaces/pokeapi/services/pokeapi/proxy/api/v2/
@@ -121,6 +119,17 @@ jobs:
121119
kubectl logs -l component=pokeapi -n pokeapi --tail=10 || echo "No PokeAPI logs yet"
122120
echo "=== Checking if pal-park-area data exists ==="
123121
kubectl exec -n pokeapi deployment/pokeapi -- python manage.py shell -c "from pokemon_v2.models import PalParkArea; print(f'PalParkArea count: {PalParkArea.objects.count()}')" || echo "Failed to check PalParkArea data"
122+
echo "=== Checking for failed/error pods ==="
123+
error_pods=$(kubectl get pods -n pokeapi -o jsonpath='{.items[?(@.status.phase=="Failed" || @.status.phase=="Error")].metadata.name}')
124+
if [ -n "$error_pods" ]; then
125+
echo "Found error/failed pods, showing logs:"
126+
for pod in $error_pods; do
127+
echo "=== Logs for $pod ==="
128+
kubectl logs $pod -n pokeapi --tail=50 || echo "No logs available for $pod"
129+
done
130+
else
131+
echo "No error/failed pods found"
132+
fi
124133
125134
- name: Debug network connectivity
126135
run: |

Resources/k8s/kustomize/base/jobs/load-graphql.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ spec:
1818
done;
1919
containers:
2020
- name: load-graphql
21-
image: debian:buster
21+
image: debian:bullseye
2222
env:
2323
- name: HASURA_GRAPHQL_ADMIN_SECRET
2424
valueFrom:

0 commit comments

Comments
 (0)