Forrest logo
back to the stern tool

stern:tldr:a18a9

stern: Tail matched pods with a specific label.
$ stern ${pod_query} --selector ${release=canary}
try on your machine

This command utilizes the Stern tool to view and tail logs from Kubernetes pods that match a specific label selector. Here is an explanation of each part of the command:

  • stern: Stern is a command-line tool used for tailing logs from multiple pods or containers in Kubernetes. It provides a convenient way to view logs in real-time.

  • ${pod_query}: This is a placeholder variable that represents the query to select the pods whose logs you want to tail. The actual query would be replaced with the desired value when executing the command.

  • --selector ${release=canary}: This parameter is used to specify the label selector for the pods. In this case, it selects pods with a label release that has a value of canary.

By running this command with the appropriate values provided for ${pod_query}, it will tail and display logs from the selected pods that match the defined label selector.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the stern tool