Is there a way to check multiple pods in one command, perhaps something like
kubectl logs pods/pod1 pods/pod2 [container-name]
?
Is there a way to check multiple pods in one command, perhaps something like
kubectl logs pods/pod1 pods/pod2 [container-name]
?
The kubectl logs can't print logs from multiple pods specified by names.
Although, you can use the -l, --selector='' flag as a label query to filter on. e.g.:
# Return snapshot logs from all containers in pods defined by label app=nginx
kubectl logs -lapp=nginx --all-containers=true
If you need to print logs from multiple different pods, there are some projects that can help:
kubectl logs -f but for multiple pods.kubectl context to interactively select namespaces and multiple pods to download logs from. It basically runs kubectl logs in a loop for all containers, redirecting the logs to local files.