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 dup plugin #2831

Open
wants to merge 1 commit 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
1 change: 1 addition & 0 deletions plugins/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ Following is an example of some of plugin files in this directory. Other files a
| 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) |
| dup.yaml | Duplicate, edit and Debug resources | all | Shift-d/e/v | [dup](https://github.com/vash/dup) |
[1]: https://kubernetes.io/docs/tasks/debug/debug-application/debug-running-pod/#ephemeral-container
[2]: https://github.com/nicolaka/netshoot
84 changes: 84 additions & 0 deletions plugins/dup.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
plugins:
dup:
shortCut: Shift-D
description: Duplicate
scopes:
- all
command: bash
background: false
confirm: true
args:
- -c
- "kubectl dup -k $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_edit:
# Prompted to edit a new duplicate resource
shortCut: Shift-E
description: Duplicate + Edit
scopes:
- all
command: bash
background: false
confirm: true
args:
- -c
- "kubectl dup $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_pods:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- pods
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_deploy:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- deployments
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_sts:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- statefulsets
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_cronjob:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- cronjobs
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"
dup_debug_jobs:
# Spawn a resource with no readiness probes and infinite running command.
shortCut: Shift-V
description: Debug
scopes:
- jobs
command: bash
background: true
confirm: true
args:
- -c
- "kubectl dup -kdl $RESOURCE_NAME $NAME -n $NAMESPACE --context $CONTEXT"