Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metrosystems-cpe/kubectl-utility
Utility tool for observing k8s resources.
https://github.com/metrosystems-cpe/kubectl-utility
audit auditing k8s kubectl kubectl-plugin kubectl-plugins kubernetes-plugin logging pod python python3 script tail
Last synced: about 2 months ago
JSON representation
Utility tool for observing k8s resources.
- Host: GitHub
- URL: https://github.com/metrosystems-cpe/kubectl-utility
- Owner: metrosystems-cpe
- License: mit
- Archived: true
- Created: 2019-04-22T09:45:20.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-10-09T22:09:31.000Z (about 5 years ago)
- Last Synced: 2024-08-02T06:13:14.955Z (5 months ago)
- Topics: audit, auditing, k8s, kubectl, kubectl-plugin, kubectl-plugins, kubernetes-plugin, logging, pod, python, python3, script, tail
- Language: Python
- Size: 23.4 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kubectl-plugins - kubectl-utility
README
# Klogs
## Description
Script for monitoring and observing logs from k8s resources.
## Usage
```shell
usage: klogs [-h] {audit,logs} ...
Utility tool for observing kubernetes resources
positional arguments:
{audit,logs} Commands
audit Audits the state of the resource specified
logs Prints logs from multiple resources concurrentlyoptional arguments:
-h, --help show this help message and exit```
```shell
usage: klogs logs [-h] [-n ] [-i] [-v] [-ctx ] [-l ] [-f]
[-hi] [-regx <^some_word$>]
namepositional arguments:
name Resource nameoptional arguments:
-h, --help show this help message and exit
-n , --namespace
Namespace
-i, --inverse Does not container 'name'
-v, --verbose Prints commands used
-ctx , --context
Specify which context to use based on kube-config
-l , --lines
No of lines to take from each log. Defaults to 1000
-f, --follow Follows logs
-hi, --highlight Will highlight errors and warnings
-regx <^some_word$>, --custom-regx <^some_word$>
Will highlight output based on the regx provided```
```
usage: klogs audit [-h] [-n ] [-i] [-v] [-ctx ] [-ma ]
namepositional arguments:
name Resource nameoptional arguments:
-h, --help show this help message and exit
-n , --namespace
Namespace
-i, --inverse Does not container 'name'
-v, --verbose Prints commands used
-ctx , --context
Specify which context to use based on kube-config
-ma , --max-age
Will highlight pods that surpass the limit```
## Examples
Get one line from each pod's log
```shell
$ ./klogs logs --namespace kube-system --verbose apiserver --lines 2 --highlight
``````shell
$ ./klogs audit -v -n kube-system -ctx prod -ma 100 apiserver
```