kt is short for Kubernetes Tail. It behaves like kubect logs -f
and
its usage is similar to kubectl get
.
- Tail all containers in a pod by default.
- Automatically tail new pods, discard deleted pods and retry if the pod switches to running phase from pending phase.
- Recover from containers restart.
- Auto completion.
- Colorized output.
NOTE: If you install
kt
using homebrew, the completion is already installed.
Load the completion code into current shell
## bash
$ source <(kt --completion bash)
## zsh
$ source <(kt --completion zsh)
$ kt foo
or
$ kt 'foo-\w+'
$ kt -n prod -lapp=foo
Currently only the following resources are supported:
- Service
- Deployment
- StatefulSet
- DaemonSet
- HPA
- Job
- ReplicaSet
- ReplicationController
- Cronjob(partially supported. You must specify labels in the pod template.)
$ kt hpa foo
# You could limit which containers are tailed using regexp
$ kt -c 'sidecar-\w' svc foo
$ kt -n test --tail 30 deploy foo
$ kt --timestamps sts foo
$ kt --context prod ds foo
$ kt --cluster dev job foo
Using Homebrew:
$ brew tap knight42/tap
$ brew install knight42/tap/kt
Or download from the release page.