HiveBrain v1.2.0
Get Started
← Back to all entries
snippetbashTip

stern — Tail multiple pods and containers from Kubernetes. More information: <https://github.com/stern/stern

Submitted by: @import:tldr-pages··
0
Viewed 0 times
tailcommandmultipleandclisternpodscontainers

Problem

How to use the stern command: Tail multiple pods and containers from Kubernetes. More information: <https://github.com/stern/stern#usage>.

Solution

stern — Tail multiple pods and containers from Kubernetes. More information: <https://github.com/stern/stern#usage>.

Tail all pods within a current namespace:
stern .


Tail all pods with a specific status:
stern . --container-state {{running|waiting|terminated}}


Tail all pods that matches a given regex:
stern {{pod_query}}


Tail matched pods from all namespaces:
stern {{pod_query}} {{[-A|--all-namespaces]}}


Tail matched pods from 15 minutes ago:
stern {{pod_query}} {{[-s|--since]}} 15m


Tail matched pods with a specific label:
stern {{pod_query}} {{[-l|--selector]}} {{release=canary}}

Code Snippets

Tail all pods within a current namespace

stern .

Tail all pods with a specific status

stern . --container-state {{running|waiting|terminated}}

Tail all pods that matches a given `regex`

stern {{pod_query}}

Tail matched pods from all namespaces

stern {{pod_query}} {{[-A|--all-namespaces]}}

Tail matched pods from 15 minutes ago

stern {{pod_query}} {{[-s|--since]}} 15m

Context

tldr-pages: common/stern

Revisions (0)

No revisions yet.