feat: log against deployment since 24h ago by default

This commit is contained in:
hophacker 2022-01-09 14:48:13 +08:00
parent fdc1eca0aa
commit 42e9a4168b

View File

@ -117,8 +117,8 @@ function klogs {
KCONTEXT="${i#*=}" KCONTEXT="${i#*=}"
shift shift
;; ;;
-p) -d)
PROJECT="$2" DEPLOYMENT="$2"
shift; shift shift; shift
;; ;;
-i) -i)
@ -132,8 +132,8 @@ function klogs {
esac esac
done done
if [[ "$PROJECT" != "" ]]; then if [[ "$DEPLOYMENT" != "" ]]; then
kubectl logs -f deployment/$PROJECT --all-containers=true --since=5s --pod-running-timeout=2s $finalopts kubectl logs -f deployment/$DEPLOYMENT --all-containers=true --since=24h --pod-running-timeout=2s $finalopts
elif [[ "$INSTANCE" != "" ]]; then elif [[ "$INSTANCE" != "" ]]; then
while true; do while true; do
kubectl logs -f --max-log-requests=10 -l app.kubernetes.io/instance=$INSTANCE 1>&0 kubectl logs -f --max-log-requests=10 -l app.kubernetes.io/instance=$INSTANCE 1>&0