9191
9292 exit $?
9393
94+ - name : show jobs and pods
95+ run : |
96+ echo "===== Jobs ====="
97+ kubectl get jobs -o wide
98+ echo "===== Pods (pgstac) ====="
99+ kubectl get pods | grep -i pgstac || true
100+
94101 - name : debug pgstac-eoapi-superuser-init-db job failure
95102 if : steps.helm-render-install-eoapi-templates.outcome == 'failure'
96103 continue-on-error : true
99106
100107 # Get job details
101108 echo "===== pgstac-eoapi-superuser-init-db Job Details ====="
102- kubectl get job pgstac-eoapi-superuser-init-db -o yaml || echo "Could not get job details"
109+ kubectl get job "$RELEASE_NAME- pgstac-eoapi-superuser-init-db" -o yaml || echo "Could not get job details"
103110
104111 # Get pod details
105112 echo "===== Pod Details ====="
@@ -138,7 +145,7 @@ jobs:
138145
139146 # Get job details
140147 echo "===== pgstac-migrate Job Details ====="
141- kubectl get job pgstac-migrate -o yaml || echo "Could not get pgstac-migrate job details"
148+ kubectl get job "$RELEASE_NAME- pgstac-migrate" -o yaml || echo "Could not get pgstac-migrate job details"
142149
143150 # Get pod details
144151 echo "===== pgstac-migrate Pod Details ====="
@@ -147,7 +154,7 @@ jobs:
147154 # Extract logs from pgstac-migrate pod(s)
148155 echo "===== pgstac-migrate Pod Logs ====="
149156 echo "Looking for completed pods from pgstac-migrate job..."
150- COMPLETED_PODS=$(kubectl get pods --selector=job-name=pgstac-migrate --field-selector=status.phase=Succeeded,status.phase=Failed -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
157+ COMPLETED_PODS=$(kubectl get pods --selector=job-name="$RELEASE_NAME- pgstac-migrate" --field-selector=status.phase=Succeeded,status.phase=Failed -o jsonpath='{.items[*].metadata.name}' 2>/dev/null)
151158 if [ -n "$COMPLETED_PODS" ]; then
152159 echo "Found completed pods from pgstac-migrate job. Extracting logs from each:"
153160 for POD in $COMPLETED_PODS; do
@@ -174,22 +181,18 @@ jobs:
174181 timeout-minutes : 3
175182 continue-on-error : true
176183 run : |
177- # Now wait for services to boot up
178- while [[ -z "$(kubectl get pod | grep "^raster-$RELEASE_NAME-.*$" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} | grep "GET /.*/healthz" | head -n 1)" ]]; do
179- echo "still waiting for raster service to start..."
180- sleep 1
181- done
182- echo "raster service has started, moving on..."
183- while [[ -z "$(kubectl get pod | grep "^vector-$RELEASE_NAME-.*$" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} | grep "GET /.*/healthz" | head -n 1)" ]]; do
184- echo "still waiting for vector service to start..."
185- sleep 1
186- done
187- echo "vector service has started, moving on..."
188- while [[ -z "$(kubectl get pod | grep "^stac-$RELEASE_NAME-.*$" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} | grep "GET /.*/_mgmt/ping" | head -n 1)" ]]; do
189- echo "still waiting for stac service to start..."
190- sleep 1
191- done
192- echo "all services have started, moving on..."
184+ # Wait for services to be ready using native readiness checks
185+ echo "Waiting for raster service to be ready..."
186+ kubectl wait --for=condition=Ready pod -l app=raster-${RELEASE_NAME} --timeout=180s
187+ echo "raster service is ready, moving on..."
188+
189+ echo "Waiting for vector service to be ready..."
190+ kubectl wait --for=condition=Ready pod -l app=vector-${RELEASE_NAME} --timeout=180s
191+ echo "vector service is ready, moving on..."
192+
193+ echo "Waiting for stac service to be ready..."
194+ kubectl wait --for=condition=Ready pod -l app=stac-${RELEASE_NAME} --timeout=180s
195+ echo "all services are ready, moving on..."
193196
194197 - name : cleanup if services fail to boot
195198 if : steps.watchservices.outcome == 'failure'
@@ -200,9 +203,9 @@ jobs:
200203 echo "===== Pod Status ====="
201204 kubectl get pods
202205
203- # Extract logs from raster pod init container (wait-for-pgstacbootstrap )
204- echo "===== Raster Pod Init Container Logs (wait-for-pgstacbootstrap ) ====="
205- kubectl get pod | grep "^raster-$RELEASE_NAME" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} -c wait-for-pgstacbootstrap --tail=100 || echo "Could not get raster init container logs"
206+ # Extract logs from raster pod init container (wait-for-pgstac-jobs )
207+ echo "===== Raster Pod Init Container Logs (wait-for-pgstac-jobs ) ====="
208+ kubectl get pod | grep "^raster-$RELEASE_NAME" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} -c wait-for-pgstac-jobs --tail=100 || echo "Could not get raster init container logs"
206209
207210 # Extract logs from raster pod main container
208211 echo "===== Raster Pod Main Container Logs ====="
@@ -268,9 +271,9 @@ jobs:
268271 echo "===== Pod Status ====="
269272 kubectl get pods
270273
271- # Extract logs from raster pod init container (wait-for-pgstacbootstrap )
272- echo "===== Raster Pod Init Container Logs (wait-for-pgstacbootstrap ) ====="
273- kubectl get pod | grep "^raster-$RELEASE_NAME" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} -c wait-for-pgstacbootstrap --tail=100 || echo "Could not get raster init container logs"
274+ # Extract logs from raster pod init container (wait-for-pgstac-jobs )
275+ echo "===== Raster Pod Init Container Logs (wait-for-pgstac-jobs ) ====="
276+ kubectl get pod | grep "^raster-$RELEASE_NAME" | cut -d' ' -f1 | xargs -I{} kubectl logs pod/{} -c wait-for-pgstac-jobs --tail=100 || echo "Could not get raster init container logs"
274277
275278 # Extract logs from raster pod main container
276279 echo "===== Raster Pod Main Container Logs ====="
0 commit comments