Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add helm diff plugin #3017

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 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)<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