kt

command module
v0.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 27 Imported by: 0

README

kt

kt is short for Kubernetes Tail. It behaves like kubect logs -f and its usage is similar to kubectl get.

Table of Contents

0. Features

  • 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.

1. Usage

1.1 Install bash/zsh completion

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)
1.2 Filter pods by name or regexp
$ kt foo

or

$ kt 'foo-\w+'
1.3 Filter pods by labels
$ kt -n prod -lapp=foo
1.4 Tail pods belong to a higher level object

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

2. Installtion

Using Homebrew:

$ brew tap knight42/tap
$ brew install knight42/tap/kt

Or download from the release page.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg
api
log

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL