From b92974ec37c1a4ab2b84daa27192b2003b4354a0 Mon Sep 17 00:00:00 2001 From: hophacker Date: Mon, 7 Dec 2020 02:20:08 +0800 Subject: [PATCH] repeatedly do k logs -f for klogs -i --- zsh/functions.zsh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/zsh/functions.zsh b/zsh/functions.zsh index 71decea..c7f7ac2 100644 --- a/zsh/functions.zsh +++ b/zsh/functions.zsh @@ -402,7 +402,11 @@ function klogs { if [[ "$PROJECT" != "" ]]; then kubectl logs -f deployment/$PROJECT --all-containers=true --since=5s --pod-running-timeout=2s $finalopts elif [[ "$INSTANCE" != "" ]]; then - kubectl logs -f --max-log-requests=10 -l app.kubernetes.io/instance=$INSTANCE + while true; do + kubectl logs -f --max-log-requests=10 -l app.kubernetes.io/instance=$INSTANCE 1>&0 + echo "Waiting..." + sleep 2 + done fi }