在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):johanhaleby/kubetail开源软件地址(OpenSource Url):https://github.com/johanhaleby/kubetail开源编程语言(OpenSource Language):Shell 100.0%开源软件介绍(OpenSource Introduction):KubetailBash script that enables you to aggregate (tail/follow) logs from multiple pods into one stream. This is the same as running "kubectl logs -f " but for multiple pods. InstallationJust download the kubetail file (or any of the releases) and you're good to go. HomebrewYou can also install kubetail using brew:
It's also possible to install kubetail abbreviated to
Note that you may need to run Use ASDFYou can install kubetail using the asdf version manager.
To find out the available versions to install, you can run the following command:
ZSH pluginIf you're using a ZSH plugin manager, you can install AntigenIf you're using Antigen:
oh-my-zshIf you're using oh-my-zsh:
zgenIf you're using zgen:
CompletionThe easiest option is to install kubetail from homebrew to dynamically display the pods names on
Don't forget to restart your terminal afterwards. UsageFirst find the names of all your pods:
This will return a list looking something like this: NAME READY STATUS RESTARTS AGE
app1-v1-aba8y 1/1 Running 0 1d
app1-v1-gc4st 1/1 Running 0 1d
app1-v1-m8acl 1/1 Running 0 6d
app1-v1-s20d0 1/1 Running 0 1d
app2-v31-9pbpn 1/1 Running 0 1d
app2-v31-q74wg 1/1 Running 0 1d
my-demo-v5-0fa8o 1/1 Running 0 3h
my-demo-v5-yhren 1/1 Running 0 2h To tail the logs of the two "app2" pods in one go simply do:
To tail only a specific container from multiple pods specify the container like this:
You can repeat
To tail multiple applications at the same time seperate them by comma:
For advanced matching you can use regular expressions:
To tail logs within a specific namespace, make sure to append the namespace flag after you have provided values for containers and applications:
Supply
ColorsBy using the
Example:
If you find that some colors are difficult to see then they can be skipped by supplying the color index either to the Filtering / Highlighting etckubetail itself doesn't have filtering or highlighting capabilities built-in. If you're on MacOSX I recommend using iTerm2 which allows for continuous highlighting of search terms, good scrolling capabilities and multitab arrangements. Another useful feature of iTerm2 is the "timeline" ( If you're not using iTerm2 or think that kubetail is lacking in features there's a fork of kubetail made by Alan Stebbens that allows for richer configuration and uses multitail and bash-lib. Alan has been kind enough to provide a pull request but my current thinking is that I'd like kubetail to stay simple and small and not use any dependencies. Environmentkubetail can take default option values from environment variables matching the option name.
MorePull requests are very welcome! See also: http://code.haleby.se/2015/11/13/tail-logs-from-multiple-pods-simultaneously-in-kubernetes/ |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论