kail

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2017 License: MIT Imports: 22 Imported by: 0

README

kail: kubernetes tail Build Status

Kubernetes tail. Streams logs from all containers of all matched pods.

asciicast

# view logs from all pods
$ kail

# all pods named 'x'
$ kail --pod x

# containers 'a' and 'b' of pod named 'y' in namespace 'x'
$ kail --pod x/y -c a -c b

# all pods in namespace 'x' or 'y'
$ kail --ns x --ns y

# pods matching service 'x'
$ kail --svc x

# pods controled by replication controller 'x'
$ kail --rc x

# pods controled by replica set 'x'
$ kail --rc x

# pods for deployment 'x'
$ kail --deploy x

# pods for daemonset 'x'
$ kail --ds x

# pods on node 'x'
$ kail --node x

# pod with labels x=a, or x=b and y != z
$ kail --label 'x in (a, b)' --label 'y != z'

# pods controlled by replica set 'x', targeted by service 'y', on node 'z'
$ kail --rs x --svc y --node z

# run via kubectl
kubectl run -it --rm -l kail.ignore=true --restart=Never --image=abozanich/kail kail

# run via kubectl for service 'x'
kubectl run -it --rm -l kail.ignore=true --restart=Never --image=abozanich/kail kail -- --svc x

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerFilter added in v0.2.0

type ContainerFilter interface {
	Accept(cs v1.ContainerStatus) bool
}

func NewContainerFilter added in v0.2.0

func NewContainerFilter(names []string) ContainerFilter

type Controller

type Controller interface {
	Events() <-chan Event
	Close()
	Done() <-chan struct{}
}

func NewController

func NewController(
	ctx context.Context,
	cs kubernetes.Interface,
	pcontroller pod.Controller,
	filter ContainerFilter) (Controller, error)

type DS

type DS interface {
	Pods() pod.Controller
	Ready() <-chan struct{}
	Done() <-chan struct{}
	Close()
}

type DSBuilder

type DSBuilder interface {
	WithIgnore(selectors ...labels.Selector) DSBuilder
	WithSelectors(selectors ...labels.Selector) DSBuilder
	WithPods(id ...nsname.NSName) DSBuilder
	WithNamespace(name ...string) DSBuilder
	WithService(id ...nsname.NSName) DSBuilder
	WithNode(name ...string) DSBuilder
	WithRC(id ...nsname.NSName) DSBuilder
	WithRS(id ...nsname.NSName) DSBuilder
	WithDS(id ...nsname.NSName) DSBuilder
	WithDeployment(id ...nsname.NSName) DSBuilder

	Create(ctx context.Context, cs kubernetes.Interface) (DS, error)
}

func NewDSBuilder

func NewDSBuilder() DSBuilder

type Event

type Event interface {
	Source() EventSource
	Log() []byte
}

type EventSource

type EventSource interface {
	Namespace() string
	Name() string
	Container() string
	Node() string
}

type Writer

type Writer interface {
	Print(event Event) error
	Fprint(w io.Writer, event Event) error
}

func NewWriter

func NewWriter(out io.Writer) Writer

Directories

Path Synopsis
cmd
kail command

Jump to

Keyboard shortcuts

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