Skip to content

Commit a6a5c8a

Browse files
committed
pod update
1 parent 1b5212d commit a6a5c8a

1 file changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/pod-logs.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ on:
1010
tail:
1111
description: "Log lines to tail per pod"
1212
required: false
13-
default: "800"
13+
default: "2000"
14+
since:
15+
description: "Only logs newer than this (e.g. 1h, 30m, 2026-07-08T14:00:00Z)"
16+
required: false
17+
default: "1h"
1418
grep:
1519
description: "Optional case-insensitive filter (e.g. SubmitPost, Traceback, 500)"
1620
required: false
@@ -46,36 +50,38 @@ jobs:
4650
- name: Collect pod status + logs
4751
env:
4852
TAIL: ${{ github.event.inputs.tail }}
53+
SINCE: ${{ github.event.inputs.since }}
4954
GREP: ${{ github.event.inputs.grep }}
5055
PREVIOUS: ${{ github.event.inputs.previous }}
5156
run: |
5257
NS=jaseci-blogs
5358
DEPLOY=deployment/jaseci-blogs
59+
# tee everything to BOTH the step log (CLI-readable) and the job summary.
5460
{
5561
echo "## jaseci-blogs pod diagnostics"
56-
echo "_$(date -u) — tail=${TAIL:-800} grep='${GREP}' previous=${PREVIOUS}_"
62+
echo "_$(date -u) — since=${SINCE:-1h} tail=${TAIL:-2000} grep='${GREP}' previous=${PREVIOUS}_"
5763
echo ""
5864
echo "### Pods"
5965
echo '```'
6066
kubectl get pods -n "$NS" -o wide 2>&1 || true
6167
echo '```'
62-
echo "### App logs ($DEPLOY)"
68+
echo "### App logs ($DEPLOY, since ${SINCE:-1h})"
6369
echo '```'
6470
if [ -n "$GREP" ]; then
65-
kubectl logs -n "$NS" "$DEPLOY" --all-containers --timestamps --tail="${TAIL:-800}" 2>&1 \
71+
kubectl logs -n "$NS" "$DEPLOY" --all-containers --timestamps --since="${SINCE:-1h}" --tail="${TAIL:-2000}" 2>&1 \
6672
| grep -iE "$GREP" || echo "(no lines matched '$GREP')"
6773
else
68-
kubectl logs -n "$NS" "$DEPLOY" --all-containers --timestamps --tail="${TAIL:-800}" 2>&1 || true
74+
kubectl logs -n "$NS" "$DEPLOY" --all-containers --timestamps --since="${SINCE:-1h}" --tail="${TAIL:-2000}" 2>&1 || true
6975
fi
7076
echo '```'
7177
if [ "$PREVIOUS" = "true" ]; then
7278
echo "### Previous (crashed) container logs"
7379
echo '```'
74-
kubectl logs -n "$NS" "$DEPLOY" --all-containers --previous --tail="${TAIL:-800}" 2>&1 || echo "(no previous container)"
80+
kubectl logs -n "$NS" "$DEPLOY" --all-containers --previous --tail="${TAIL:-2000}" 2>&1 || echo "(no previous container)"
7581
echo '```'
7682
fi
7783
echo "### describe (events / restarts)"
7884
echo '```'
7985
kubectl describe pods -n "$NS" -l app=jaseci-blogs 2>&1 | tail -60 || true
8086
echo '```'
81-
} >> "$GITHUB_STEP_SUMMARY"
87+
} | tee -a "$GITHUB_STEP_SUMMARY"

0 commit comments

Comments
 (0)