Skip to content
This repository has been archived by the owner on Feb 5, 2021. It is now read-only.
/ klf Public archive

Simple 'kubectl logs -f' wrapper for multiple pods.

License

Notifications You must be signed in to change notification settings

flowerinthenight/klf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I suggest https://github.com/wercker/stern tool instead, which is much more mature and does the same thing.


Overview

I use kubectl logs -f {pod-name} [container-name] heavily when developing/debugging applications in Kubernetes. It's quite difficult if I have multiple replicas though. kubectl logs -l key=value works to some extent but not with the -f flag. I just wish I could do something like:

$ kubectl logs -f {service-name} [container-name]

or

$ kubectl logs -f {deployment-name} [container-name]

This simple wrapper tool does exactly just that.

Installation

$ go get -u -v github.com/flowerinthenight/klf

Usage

# General usage:
$ klf tail <svc|dep> <svc-name|deployment-name> [container-name] [--add-prefix] 

Examples

# Tail a service `svc1` with only one container in the pod:
$ klf tail svc svc1

# Tail a deployment `deploy1` with only one container in the pod:
$ klf tail dep deploy1

# Tail a service `svc1`'s sidecar container:
$ klf tail svc svc1 git-sync

# Tail a deployment `deploy1` with pod name as prefix:
$ klf tail dep deploy1 --add-prefix

Releases

No releases published

Packages

No packages published

Languages