Skip to content

Commit 69ba970

Browse files
prontclaude
andcommitted
chore(ci): collect K8s diagnostics on E2E test failure
Add a step that runs on failure to capture pod logs, events, configs, and node resource usage from all vector-* namespaces. This avoids deep manual investigation when K8s E2E tests fail. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b59c9a2 commit 69ba970

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

.github/workflows/k8s_e2e.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,48 @@ jobs:
209209
max_attempts: 3
210210
command: make test-e2e-kubernetes
211211

212+
- name: Collect K8s diagnostics on failure
213+
if: failure()
214+
run: |
215+
echo "=== Namespaces ==="
216+
kubectl get namespaces 2>&1 || true
217+
218+
for ns in $(kubectl get namespaces -o jsonpath='{.items[*].metadata.name}' | tr ' ' '\n' | grep -E '^vector-'); do
219+
echo ""
220+
echo "=========================================="
221+
echo "=== Namespace: $ns ==="
222+
echo "=========================================="
223+
224+
echo "--- Pods ---"
225+
kubectl get pods -n "$ns" -o wide 2>&1 || true
226+
227+
echo "--- Pod descriptions ---"
228+
kubectl describe pods -n "$ns" 2>&1 || true
229+
230+
echo "--- Container logs ---"
231+
for pod in $(kubectl get pods -n "$ns" -o jsonpath='{.items[*].metadata.name}' 2>/dev/null); do
232+
echo "--- Logs: $pod ---"
233+
kubectl logs -n "$ns" "$pod" --tail=100 2>&1 || true
234+
echo "--- Previous logs: $pod ---"
235+
kubectl logs -n "$ns" "$pod" --previous --tail=50 2>&1 || true
236+
done
237+
238+
echo "--- Events ---"
239+
kubectl get events -n "$ns" --sort-by=.lastTimestamp 2>&1 || true
240+
241+
echo "--- ConfigMaps ---"
242+
kubectl get configmaps -n "$ns" -o yaml 2>&1 || true
243+
done
244+
245+
echo ""
246+
echo "=== Node resources ==="
247+
kubectl top nodes 2>&1 || true
248+
kubectl describe nodes 2>&1 | grep -A20 "Allocated resources" || true
249+
250+
echo ""
251+
echo "=== Minikube logs (last 100 lines) ==="
252+
minikube logs --length=100 2>&1 || true
253+
212254
final-result:
213255
name: K8s E2E Suite
214256
runs-on: ubuntu-24.04

0 commit comments

Comments
 (0)