From 7e8f0de4753c22cd756e15c3fa561b461936c2d3 Mon Sep 17 00:00:00 2001 From: Helen Tseng Date: Sun, 8 Dec 2024 03:38:38 +0800 Subject: [PATCH 1/3] feat: add helm diff plugin --- plugins/helm-diff.yaml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/helm-diff.yaml diff --git a/plugins/helm-diff.yaml b/plugins/helm-diff.yaml new file mode 100644 index 0000000000..2aaaf48010 --- /dev/null +++ b/plugins/helm-diff.yaml @@ -0,0 +1,31 @@ +# Requires helm-diff plugin installed: https://github.com/databus23/helm-diff +# In helm view: Diff with Previous Revision +# In helm-history view: Diff with Current Revision +plugins: + helm-diff-previous: + shortCut: Shift-D + confirm: false + description: Diff with Previous Revision + scopes: + - helm + command: bash + background: false + args: + - -c + - >- + LAST_REVISION=$(($COL-REVISION-1)); + helm diff revision $COL-NAME $COL-REVISION $LAST_REVISION --kube-context $CONTEXT --namespace $NAMESPACE --color | less -RK + helm-diff-current: + shortCut: Shift-Q + confirm: false + description: Diff with Current Revision + scopes: + - history + command: bash + background: false + args: + - -c + - >- + RELEASE_NAME=$(echo $NAME | cut -d':' -f1); + LATEST_REVISION=$(helm history -n $NAMESPACE --kube-context $CONTEXT $RELEASE_NAME | grep deployed | cut -d$'\t' -f1 | tr -d ' \t'); + helm diff revision $RELEASE_NAME $LATEST_REVISION $COL-REVISION --kube-context $CONTEXT --namespace $NAMESPACE --color | less -RK \ No newline at end of file From 7457d6f6a6016e309ade9cd6930e44fd7f230cc2 Mon Sep 17 00:00:00 2001 From: Helen Tseng Date: Sun, 8 Dec 2024 22:57:25 +0800 Subject: [PATCH 2/3] feat: Add helm-diff to plugin readme and sort items alphabetically --- plugins/README.md | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/plugins/README.md b/plugins/README.md index 4511d974a9..64c004c99c 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -6,18 +6,19 @@ Following is an example of some of plugin files in this directory. Other files a | Plugin-Name | Description | Available on Views | Shortcut | Kubectl plugin, external dependencies | | ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------- |-----------| ------------------------------------------------------------------------------------- | -| debug-container.yml | Add [ephemeral debug container](1)
([nicolaka/netshoot](2)) | containers | Shift-d | | -| dive.yml | Dive image layers | containers | d | [Dive](https://github.com/wagoodman/dive) | -| get-all.yml | get all resources in a namespace | all | g | [Krew](https://krew.sigs.k8s.io/), [ketall](https://github.com/corneliusweig/ketall/) | -| job_suspend.yml | Suspends a running cronjob | cronjobs | Ctrl-s | | -| k3d_root_shell.yml | Root shell to k3d container | containers | Shift-s | [jq](https://stedolan.github.io/jq/) | -| resource-recommendations.yml | View recommendations for CPU/Memory requests based on historical data | deployments/daemonsets/statefulsets | Shift-k | [Robusta KRR](https://github.com/robusta-dev/krr) | -| log_stern.yml | View resource logs using stern | pods | Ctrl-l | | -| log_jq.yml | View resource logs using jq | pods | Ctrl-j | kubectl-plugins/kubectl-jq | -| log_full.yml | get full logs from pod/container | pods/containers | Ctrl-l | | | ai-incident-investigation.yaml | Run AI investigation on application issues to find the root cause in seconds | all | Shift-h/o | [HolmesGPT](https://github.com/robusta-dev/holmesgpt) | -| toggle-keda | Enable/disable [keda](3) ScaledObject autoscaler | scaledobjects | Ctrl-N | | -| trace-dns | Trace DNS resolution using Inspektor Gadget (4) | containers/pods/nodes | Shift-d | | +| debug-container.yaml | Add [ephemeral debug container](1)
([nicolaka/netshoot](2)) | containers | Shift-d | | +| 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/) | +| 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_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 | | [1]: https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#ephemeral-container [2]: https://github.com/nicolaka/netshoot From 6e463f566ceb5ddb2f37494d65be5d870e4e1b92 Mon Sep 17 00:00:00 2001 From: Helen Tseng Date: Sun, 8 Dec 2024 23:03:03 +0800 Subject: [PATCH 3/3] chore: Adjust plugin README format --- plugins/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/plugins/README.md b/plugins/README.md index 64c004c99c..2151fc54ab 100644 --- a/plugins/README.md +++ b/plugins/README.md @@ -7,18 +7,18 @@ Following is an example of some of plugin files in this directory. Other files a | Plugin-Name | Description | Available on Views | Shortcut | Kubectl plugin, external dependencies | | ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------- |-----------| ------------------------------------------------------------------------------------- | | ai-incident-investigation.yaml | Run AI investigation on application issues to find the root cause in seconds | all | Shift-h/o | [HolmesGPT](https://github.com/robusta-dev/holmesgpt) | -| debug-container.yaml | Add [ephemeral debug container](1)
([nicolaka/netshoot](2)) | containers | Shift-d | | -| 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/) | -| 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_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 | | +| debug-container.yaml | Add [ephemeral debug container](1)
([nicolaka/netshoot](2)) | containers | Shift-d | | +| 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/) | +| 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_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 | | [1]: https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#ephemeral-container [2]: https://github.com/nicolaka/netshoot