log with instance name from label
This commit is contained in:
parent
c48ee19aa8
commit
224552e020
@ -217,7 +217,7 @@ alias brewu='brew update && brew upgrade && brew cleanup && brew doctor'
|
|||||||
alias emacs="env LC_CTYPE=zh_CN.UTF-8 emacs"
|
alias emacs="env LC_CTYPE=zh_CN.UTF-8 emacs"
|
||||||
|
|
||||||
# rails
|
# rails
|
||||||
alias rails_setup='rails db:reset db:seed'
|
alias rails_setup='rails db:reset; rails db:seed RAILS_ENV=test'
|
||||||
alias rails_test='rspec && rubocop'
|
alias rails_test='rspec && rubocop'
|
||||||
alias rubocop='rubocop --require rubocop-performance --format progress'
|
alias rubocop='rubocop --require rubocop-performance --format progress'
|
||||||
alias psetup='rake parallel:setup'
|
alias psetup='rake parallel:setup'
|
||||||
|
@ -389,6 +389,10 @@ function klogs {
|
|||||||
PROJECT="$2"
|
PROJECT="$2"
|
||||||
shift; shift
|
shift; shift
|
||||||
;;
|
;;
|
||||||
|
-i)
|
||||||
|
INSTANCE="$2"
|
||||||
|
shift; shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
finalopts+=($1)
|
finalopts+=($1)
|
||||||
shift
|
shift
|
||||||
@ -396,7 +400,11 @@ function klogs {
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
kubectl --context $KCONTEXT logs -f deployment/$PROJECT --all-containers=true --since=5s --pod-running-timeout=2s $finalopts
|
if [[ "$PROJECT" != "" ]]; then
|
||||||
|
kubectl --context $KCONTEXT logs -f deployment/$PROJECT --all-containers=true --since=5s --pod-running-timeout=2s $finalopts
|
||||||
|
elif [[ "$INSTANCE" != "" ]]; then
|
||||||
|
kubectl --context $KCONTEXT logs -f --max-log-requests=10 -l app.kubernetes.io/instance=$INSTANCE
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function rgm {
|
function rgm {
|
||||||
|
Loading…
Reference in New Issue
Block a user