Skip to content

Commit

Permalink
feat: add helm diff plugin (#3017)
Browse files Browse the repository at this point in the history
* feat: add helm diff plugin

* feat: Add helm-diff to plugin readme and sort items alphabetically

* chore: Adjust plugin README format
  • Loading branch information
bluesky6529 authored Jan 6, 2025
1 parent 356a09d commit 520e96a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 11 deletions.
23 changes: 12 additions & 11 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,19 @@ Following is an example of some plugin files in this directory. Other files are

| Plugin-Name | Description | Available on Views | Shortcut | Kubectl plugin, external dependencies |
| ------------------------------ | ---------------------------------------------------------------------------- | ----------------------------------- |-----------| ------------------------------------------------------------------------------------- |
| debug-container.yml | Add [ephemeral debug container](1)<br>([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)<br>([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
Expand Down
31 changes: 31 additions & 0 deletions plugins/helm-diff.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Requires helm-diff plugin installed: https://github.com/databus23/helm-diff
# In helm view: <Shift-D> Diff with Previous Revision
# In helm-history view: <Shift-Q> 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

0 comments on commit 520e96a

Please sign in to comment.