Skip to content

Instantly share code, notes, and snippets.

@ramondelemos
Last active December 24, 2018 19:00
Show Gist options
  • Select an option

  • Save ramondelemos/c5a151e3b621f838bd94bfb00c5337bb to your computer and use it in GitHub Desktop.

Select an option

Save ramondelemos/c5a151e3b621f838bd94bfb00c5337bb to your computer and use it in GitHub Desktop.

stern

wercker status

Stern allows you to tail multiple pods on Kubernetes and multiple containers within the pod. Each result is color coded for quicker debugging.

The query is a regular expression so the pod name can easily be filtered and you don't need to specify the exact id (for instance omitting the deployment id). If a pod is deleted it gets removed from tail and if a new pod is added it automatically gets tailed.

When a pod contains multiple containers Stern can tail all of them too without having to do this manually for each one. Simply specify the container flag to limit what containers to show. By default all containers are listened to.

Installation on Ubuntu

Download a binary release

Copy stern binary to your local bin directory

sudo cp stern_linux_amd64 /usr/local/bin/stern

Allow execution

sudo chmod +x /usr/local/bin/stern

Execution

stern -n banking-cipcrypt -l app=banking-cipcrypt --tail 10 -c banking-cipcrypt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment