From 0a1b47ed6fcd23baf89ca9236b678f16073242be Mon Sep 17 00:00:00 2001 From: Mayank Senani Date: Wed, 6 Nov 2019 03:12:39 +0530 Subject: [PATCH] stern: add page (#3517) --- pages/osx/stern.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 pages/osx/stern.md diff --git a/pages/osx/stern.md b/pages/osx/stern.md new file mode 100644 index 000000000..5f3c10b0e --- /dev/null +++ b/pages/osx/stern.md @@ -0,0 +1,24 @@ +# Stern + +> Tail Logs from multiple pods and multiple containers on Kubernetes. +> More information: . + +- Tail logs from a specific namespace: + +`stern {{pod_name}} --container {{container}} --namespace {{namespace}}` + +- Tail logs using a particular configuration file: + +`stern {{pod_name}} --container {{container}} --kubeconfig {{path/to/kubeconfig_file}}` + +- Display the last 2 hours worth of logs, tailing for newer ones: + +`stern {{pod_name}} --container {{container}} --since {{2h}}` + +- Tail logs from pods that have specific labels across all namespaces: + +`stern --container {{container}} -l "{{KEY1=VALUE1,KEY2=VALUE2}}" --all-namespaces` + +- Tail logs from containers whose name starts with "XYZ": + +`stern {{pod_name}} --container "{{XYZ*}}"`