Project

kubetailrb

0.0
The project is in a healthy, maintained state
Tail Kubernetes pod logs at the same time. Project used for learning Ruby and Rails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 2.2.0
~> 9.2.0
~> 2.19.0
~> 5.16
~> 0.14.2
~> 13.0
~> 1.21
~> 0.6.0
~> 3.0
~> 3.10.1

Runtime

~> 4.12.0
 Project Readme

Kubetailrb

License Gem

Tail your Kubernetes pod logs at the same time.

kubetailrb

Installation

gem install kubetailrb

If you want to install directly from the repository instead:

# Install dependencies.
./bin/setup

# Install gem onto your local machine
bundle exec rake install

Usage

# show help
kubetailrb -h

# follow pod logs
kubetailrb 'clock' --namespace sandbox --raw

# follow pod structured JSON logs and display in human friendly way
kubetailrb 'clock-json' --namespace sandbox --follow
# or with shorter flags
kubetailrb 'clock-json' -n sandbox -f

# you can filter the pods using regex on the pod names
kubetailrb '^clock(?!-json)' -n sandbox -f

# you can also filter the containers using regex on the container names
kubetailrb 'clock' -n sandbox -f -c 'my-container'

# you can exclude access logs
kubetailrb 'clock' -n sandbox -f --excludes access-logs
# or Datadog logs
kubetailrb 'clock' -n sandbox -f --excludes dd-logs
# or both
kubetailrb 'clock' -n sandbox -f --excludes access-logs,dd-logs

# you can include your MDCs by adding your MDC names separated by a comma
kubetailrb 'clock' -n sandbox -f --mdcs thread.name,service.version

Development

# Open interactive prompt to allow you to experiment.
./bin/console

# Release new version
NEW_VERSION=1.0.1 \
  && sed "s/VERSION = \".*\"/VERSION = \"${NEW_VERSION}\"/" lib/kubetailrb/version.rb
  && bundle exec rake release

# Check available tasks that can be run
bundle exec rake --tasks

# During your development phase, run tests automatically.
bundle exec rake test:watch

# Run tests, cucumber features and lint.
bundle exec rake

Release a new version

Update the version in lib/kubetailrb/version.rb.

Warning

You may have to update the tests... Too lazy to update the script to also update the tests...

Then execute the script:

./bin/release

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/l-lin/kubetailrb.

Note

This project is a pet project I used to learn the Ruby programming language. So you might find lots of my personal notes in the codebase.

If you want to have something that is more complete, please look at stern project that was used as inspirations instead.

License

The gem is available as open source under the terms of the MIT License.