Add klfj for syntax highlighting json logs from kubectl pods
This commit is contained in:
parent
aa60f63a4c
commit
9385925ad9
1 changed files with 5 additions and 0 deletions
|
|
@ -423,6 +423,7 @@ kx <context> -- switch context ...
|
|||
kxs <context> -- set \$KUBE_CONTEXT
|
||||
kn <namespace> -- switch namespace ...
|
||||
klf <pod> -- follow logs
|
||||
klfj <pod> -- follow logs with json formatting
|
||||
kat <pod> [cmd] -- attach and run cmd in pod
|
||||
ks [image] [cmd -- start a new temporary pod'"
|
||||
alias k="kubectl"
|
||||
|
|
@ -442,6 +443,10 @@ alias kx="kubectl config use-context"
|
|||
function kxs() { export KUBE_CONTEXT="${1}" }
|
||||
alias kn="kubectl config set-context --current --namespace"
|
||||
alias klf="kubectl logs -f "
|
||||
function klfj() {
|
||||
[ -z $1 ] && echo 'usage: klfj <pod>' && return 1
|
||||
kubectl logs -f $@ | bat -ppl json
|
||||
}
|
||||
function kat() {
|
||||
[ -z $1 ] && echo 'usage: kat <pod> [cmd]' && return 1
|
||||
cmd=$2 && [ -z $2 ] && cmd="/bin/sh"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue