From 1323b03718ca75c13b1e08c760ee60ddd322592b Mon Sep 17 00:00:00 2001 From: Peter Denham Date: Fri, 21 Feb 2025 14:59:50 -0500 Subject: [PATCH 1/6] Create log-bunyan.yaml --- plugins/log-bunyan.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 plugins/log-bunyan.yaml diff --git a/plugins/log-bunyan.yaml b/plugins/log-bunyan.yaml new file mode 100644 index 0000000000..168501c6b2 --- /dev/null +++ b/plugins/log-bunyan.yaml @@ -0,0 +1,40 @@ +# Forwards logs to bunyan cli for formatting +# Install bunyan package globally in node e.g. node -g i bunyan +plugins: + bunyanlogsp: + shortCut: Ctrl-L + confirm: false + description: "Logs (bunyan)" + scopes: + - pod + command: bash + background: false + args: + - -ic + - | + kubectl logs -f $NAME -n $NAMESPACE --context $CONTEXT | bunyan -o short + exit 0 + bunyanlogsd: + shortCut: Ctrl-L + confirm: false + description: "Logs (bunyan)" + scopes: + - deployment + command: sh + background: false + args: + - -c + - kubectl logs -f deployment/$NAME -n $NAMESPACE --context $CONTEXT | bunyan -o short + exit 0 + bunyanlogss: + shortCut: Ctrl-L + confirm: false + description: "Logs (bunyan)" + scopes: + - service + command: sh + background: false + args: + - -c + - kubectl logs -f service/$NAME -n $NAMESPACE --context $CONTEXT | bunyan -o short + exit 0 From 5675368cf2f0a7b8c0b9cba9c4829457e7a9ed45 Mon Sep 17 00:00:00 2001 From: Peter Denham Date: Fri, 21 Feb 2025 15:35:14 -0500 Subject: [PATCH 2/6] Update log-bunyan.yaml --- plugins/log-bunyan.yaml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/log-bunyan.yaml b/plugins/log-bunyan.yaml index 168501c6b2..910a615120 100644 --- a/plugins/log-bunyan.yaml +++ b/plugins/log-bunyan.yaml @@ -20,11 +20,12 @@ plugins: description: "Logs (bunyan)" scopes: - deployment - command: sh + command: bash background: false args: - - -c - - kubectl logs -f deployment/$NAME -n $NAMESPACE --context $CONTEXT | bunyan -o short + - -ic + - | + kubectl logs -f deployment/$NAME -n $NAMESPACE --context $CONTEXT | bunyan -o short exit 0 bunyanlogss: shortCut: Ctrl-L @@ -32,9 +33,10 @@ plugins: description: "Logs (bunyan)" scopes: - service - command: sh + command: bash background: false args: - - -c - - kubectl logs -f service/$NAME -n $NAMESPACE --context $CONTEXT | bunyan -o short + - -ic + - | + kubectl logs -f service/$NAME -n $NAMESPACE --context $CONTEXT | bunyan -o short exit 0 From 964ebce1f32941d5af4805fdeaa4cd51fbe13ec7 Mon Sep 17 00:00:00 2001 From: Peter Denham Date: Sun, 23 Feb 2025 12:42:59 -0500 Subject: [PATCH 3/6] Add bunyan to readme --- plugins/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/README.md b/plugins/README.md index 26c6b72546..44184fce81 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -16,6 +16,7 @@ Following is an example of some plugin files in this directory. Other files are | keda-toggle.yaml | Enable/disable [keda](3) ScaledObject autoscaler | scaledobjects | Ctrl-N | | | log_stern.yaml | View resource logs using stern | pods | Ctrl-l | | | log_jq.yaml | View resource logs using jq | pods | Ctrl-j | kubectl-plugins/kubectl-jq | +| log-bunyan.yaml | View pods, service, deployment logs using bunyan | pods | Ctrl-l | [Bunyan](https://www.npmjs.com/package/bunyan) | | log_full.yaml | get full logs from pod/container | pods/containers | Ctrl-l | | | resource-recommendations.yaml | View recommendations for CPU/Memory requests based on historical data | deployments/daemonsets/statefulsets | Shift-k | [Robusta KRR](https://github.com/robusta-dev/krr) | | trace-dns.yaml | Trace DNS resolution using Inspektor Gadget (4) | containers/pods/nodes | Shift-d | | From 85f9735094b8f18f183c2c78b57eb61510948ae9 Mon Sep 17 00:00:00 2001 From: Peter Denham Date: Sun, 23 Feb 2025 12:44:26 -0500 Subject: [PATCH 4/6] Add install link for bunyan --- plugins/log-bunyan.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/log-bunyan.yaml b/plugins/log-bunyan.yaml index 910a615120..443c4099d9 100644 --- a/plugins/log-bunyan.yaml +++ b/plugins/log-bunyan.yaml @@ -1,5 +1,5 @@ # Forwards logs to bunyan cli for formatting -# Install bunyan package globally in node e.g. node -g i bunyan +# Install Bunyan: https://www.npmjs.com/package/bunyan plugins: bunyanlogsp: shortCut: Ctrl-L From eead893d698869c821160b18b231dfc0e862ce50 Mon Sep 17 00:00:00 2001 From: Peter Denham Date: Sun, 23 Feb 2025 13:36:47 -0500 Subject: [PATCH 5/6] fix plugin names --- plugins/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/README.md b/plugins/README.md index 44184fce81..c6c2bb9b33 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -11,13 +11,13 @@ Following is an example of some plugin files in this directory. Other files are | dive.yaml | Dive image layers | containers | d | [Dive](https://github.com/wagoodman/dive) | | get-all.yaml | get all resources in a namespace | all | g | [Krew](https://krew.sigs.k8s.io/), [ketall](https://github.com/corneliusweig/ketall/) | | helm-diff.yaml | Diff with previous revision / current revision | helm/history | Shift-D/Q | [helm-diff](https://github.com/databus23/helm-diff) | -| job_suspend.yaml | Suspends a running cronjob | cronjobs | Ctrl-s | | -| k3d_root_shell.yaml | Root shell to k3d container | containers | Shift-s | [jq](https://stedolan.github.io/jq/) | +| job-suspend.yaml | Suspends a running cronjob | cronjobs | Ctrl-s | | +| k3d-root-shell.yaml | Root shell to k3d container | containers | Shift-s | [jq](https://stedolan.github.io/jq/) | | keda-toggle.yaml | Enable/disable [keda](3) ScaledObject autoscaler | scaledobjects | Ctrl-N | | -| log_stern.yaml | View resource logs using stern | pods | Ctrl-l | | -| log_jq.yaml | View resource logs using jq | pods | Ctrl-j | kubectl-plugins/kubectl-jq | +| log-stern.yaml | View resource logs using stern | pods | Ctrl-l | | +| log-jq.yaml | View resource logs using jq | pods | Ctrl-j | kubectl-plugins/kubectl-jq | | log-bunyan.yaml | View pods, service, deployment logs using bunyan | pods | Ctrl-l | [Bunyan](https://www.npmjs.com/package/bunyan) | -| log_full.yaml | get full logs from pod/container | pods/containers | Ctrl-l | | +| log-full.yaml | get full logs from pod/container | pods/containers | Ctrl-l | | | resource-recommendations.yaml | View recommendations for CPU/Memory requests based on historical data | deployments/daemonsets/statefulsets | Shift-k | [Robusta KRR](https://github.com/robusta-dev/krr) | | trace-dns.yaml | Trace DNS resolution using Inspektor Gadget (4) | containers/pods/nodes | Shift-d | | From 768e8ed3b79d893170cd1743d0c363c9408d2673 Mon Sep 17 00:00:00 2001 From: Peter Denham Date: Sun, 23 Feb 2025 13:39:24 -0500 Subject: [PATCH 6/6] update available views --- plugins/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/README.md b/plugins/README.md index c6c2bb9b33..fab1af0f34 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -16,7 +16,7 @@ Following is an example of some plugin files in this directory. Other files are | keda-toggle.yaml | Enable/disable [keda](3) ScaledObject autoscaler | scaledobjects | Ctrl-N | | | log-stern.yaml | View resource logs using stern | pods | Ctrl-l | | | log-jq.yaml | View resource logs using jq | pods | Ctrl-j | kubectl-plugins/kubectl-jq | -| log-bunyan.yaml | View pods, service, deployment logs using bunyan | pods | Ctrl-l | [Bunyan](https://www.npmjs.com/package/bunyan) | +| log-bunyan.yaml | View pods, service, deployment logs using bunyan | pods, service, deployment | Ctrl-l | [Bunyan](https://www.npmjs.com/package/bunyan) | | log-full.yaml | get full logs from pod/container | pods/containers | Ctrl-l | | | resource-recommendations.yaml | View recommendations for CPU/Memory requests based on historical data | deployments/daemonsets/statefulsets | Shift-k | [Robusta KRR](https://github.com/robusta-dev/krr) | | trace-dns.yaml | Trace DNS resolution using Inspektor Gadget (4) | containers/pods/nodes | Shift-d | |