IOS>> kt>> 返回
项目作者: knight42

项目描述 :
yet another pods log tailer for kubernetes
高级语言: Go
项目地址: git://github.com/knight42/kt.git
创建时间: 2020-02-09T16:11:27Z
项目社区:https://github.com/knight42/kt

开源协议:MIT License

下载


" class="reference-link">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

  1. ## bash
  2. $ source <(kt --completion bash)
  3. ## zsh
  4. $ source <(kt --completion zsh)

1.2 Filter pods by name or regexp

  1. $ kt foo

or

  1. $ kt 'foo-\w+'

1.3 Filter pods by labels

  1. $ 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.)
  1. $ kt hpa foo
  2. # You could limit which containers are tailed using regexp
  3. $ kt -c 'sidecar-\w' svc foo
  4. $ kt -n test --tail 30 deploy foo
  5. $ kt --timestamps sts foo
  6. $ kt --context prod ds foo
  7. $ kt --cluster dev job foo

2. Installtion

Using Homebrew:

  1. $ brew tap knight42/tap
  2. $ brew install knight42/tap/kt

Or download from the release page.