Update readme and examples
parent
2777a7d510
commit
2c79dcfda8
|
|
@ -316,6 +316,7 @@ Entering the command mode and typing a resource name or alias, could be cumberso
|
||||||
K9s allows you to extend your command line and tooling by defining your very own cluster commands via plugins. K9s will look at `$HOME/.k9s/plugin.yml` to locate all available plugins. A plugin is defined as follows:
|
K9s allows you to extend your command line and tooling by defining your very own cluster commands via plugins. K9s will look at `$HOME/.k9s/plugin.yml` to locate all available plugins. A plugin is defined as follows:
|
||||||
|
|
||||||
* Shortcut option represents the key combination a user would type to activate the plugin
|
* Shortcut option represents the key combination a user would type to activate the plugin
|
||||||
|
* Confirm option (when enabled) lets you see the command that is going to be executed and gives you an option to confirm or prevent execution
|
||||||
* Description will be printed next to the shortcut in the k9s menu
|
* Description will be printed next to the shortcut in the k9s menu
|
||||||
* Scopes defines a collection of resources names/shortnames for the views associated with the plugin. You can specify `all` to provide this shortcut for all views.
|
* Scopes defines a collection of resources names/shortnames for the views associated with the plugin. You can specify `all` to provide this shortcut for all views.
|
||||||
* Command represents adhoc commands the plugin runs upon activation
|
* Command represents adhoc commands the plugin runs upon activation
|
||||||
|
|
@ -346,6 +347,7 @@ plugin:
|
||||||
# Defines a plugin to provide a `ctrl-l` shorcut to tail the logs while in pod view.
|
# Defines a plugin to provide a `ctrl-l` shorcut to tail the logs while in pod view.
|
||||||
fred:
|
fred:
|
||||||
shortCut: Ctrl-L
|
shortCut: Ctrl-L
|
||||||
|
confirm: false
|
||||||
description: Pod logs
|
description: Pod logs
|
||||||
scopes:
|
scopes:
|
||||||
- pods
|
- pods
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,10 @@ func TestPluginLoad(t *testing.T) {
|
||||||
k, ok := p.Plugin["blah"]
|
k, ok := p.Plugin["blah"]
|
||||||
assert.True(t, ok)
|
assert.True(t, ok)
|
||||||
assert.Equal(t, "shift-s", k.ShortCut)
|
assert.Equal(t, "shift-s", k.ShortCut)
|
||||||
|
assert.True(t, k.Confirm)
|
||||||
assert.Equal(t, "blee", k.Description)
|
assert.Equal(t, "blee", k.Description)
|
||||||
assert.Equal(t, []string{"po", "dp"}, k.Scopes)
|
assert.Equal(t, []string{"po", "dp"}, k.Scopes)
|
||||||
assert.Equal(t, "duh", k.Command)
|
assert.Equal(t, "duh", k.Command)
|
||||||
|
assert.False(t, k.Background)
|
||||||
assert.Equal(t, []string{"-n", "$NAMESPACE", "-boolean"}, k.Args)
|
assert.Equal(t, []string{"-n", "$NAMESPACE", "-boolean"}, k.Args)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
plugin:
|
plugin:
|
||||||
blah:
|
blah:
|
||||||
shortCut: shift-s
|
shortCut: shift-s
|
||||||
|
confirm: true
|
||||||
description: blee
|
description: blee
|
||||||
scopes:
|
scopes:
|
||||||
- po
|
- po
|
||||||
- dp
|
- dp
|
||||||
command: duh
|
command: duh
|
||||||
|
background: false
|
||||||
args:
|
args:
|
||||||
- -n
|
- -n
|
||||||
- $NAMESPACE
|
- $NAMESPACE
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
plugin:
|
plugin:
|
||||||
dive:
|
dive:
|
||||||
shortCut: d
|
shortCut: d
|
||||||
|
confirm: false
|
||||||
description: "Dive image"
|
description: "Dive image"
|
||||||
scopes:
|
scopes:
|
||||||
- containers
|
- containers
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ plugin:
|
||||||
# Suspends/Resumes a cronjob
|
# Suspends/Resumes a cronjob
|
||||||
toggleCronjob:
|
toggleCronjob:
|
||||||
shortCut: Ctrl-S
|
shortCut: Ctrl-S
|
||||||
|
confirm: true
|
||||||
scopes:
|
scopes:
|
||||||
- cj
|
- cj
|
||||||
description: Toggle to suspend or resume a running cronjob
|
description: Toggle to suspend or resume a running cronjob
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ plugin:
|
||||||
# Sends logs over to jq for processing. This leverages kubectl plugin kubectl-jq.
|
# Sends logs over to jq for processing. This leverages kubectl plugin kubectl-jq.
|
||||||
jqlogs:
|
jqlogs:
|
||||||
shortCut: Ctrl-J
|
shortCut: Ctrl-J
|
||||||
|
confirm: false
|
||||||
description: "Logs (jq)"
|
description: "Logs (jq)"
|
||||||
scopes:
|
scopes:
|
||||||
- po
|
- po
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ plugin:
|
||||||
# Leverage stern (https://github.com/wercker/stern) to output logs.
|
# Leverage stern (https://github.com/wercker/stern) to output logs.
|
||||||
stern:
|
stern:
|
||||||
shortCut: Ctrl-L
|
shortCut: Ctrl-L
|
||||||
|
confirm: false
|
||||||
description: "Logs <Stern>"
|
description: "Logs <Stern>"
|
||||||
scopes:
|
scopes:
|
||||||
- pods
|
- pods
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue