6 ms·
While the search offered is handy, I watch logs on multi-pod workloads via: kubectl logs -f -l app=api --max-log-requests=50 This follows along all pods w
by biot 1y ago
While the search offered is handy, I watch logs on multi-pod workloads via:
kubectl logs -f -l app=api --max-log-requests=50
This follows along all pods with the given label (app: api) for up to 50 pods or however many you want. Quite useful when I'm looking for specific output such as ERROR logs to just pipe it to grep like this:
kubectl logs -f -l app=api --max-log-requests=50 | grep ERROR
and get realtime filtering of all log output without having to tail individual pods by name.