Merge branch 'master' of github.com-derailed:derailed/k9s
commit
fea09e1a52
|
|
@ -80,7 +80,7 @@ K9s is available on Linux, macOS and Windows platforms.
|
||||||
2. Build and run the executable
|
2. Build and run the executable
|
||||||
|
|
||||||
```shell
|
```shell
|
||||||
make build && ./k9s
|
make build && ./execs/k9s
|
||||||
```
|
```
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
|
||||||
|
|
@ -69,6 +69,7 @@ type (
|
||||||
NewColor Color `yaml:"newColor"`
|
NewColor Color `yaml:"newColor"`
|
||||||
ModifyColor Color `yaml:"modifyColor"`
|
ModifyColor Color `yaml:"modifyColor"`
|
||||||
AddColor Color `yaml:"addColor"`
|
AddColor Color `yaml:"addColor"`
|
||||||
|
PendingColor Color `yaml:"pendingColor"`
|
||||||
ErrorColor Color `yaml:"errorColor"`
|
ErrorColor Color `yaml:"errorColor"`
|
||||||
HighlightColor Color `yaml:"highlightColor"`
|
HighlightColor Color `yaml:"highlightColor"`
|
||||||
KillColor Color `yaml:"killColor"`
|
KillColor Color `yaml:"killColor"`
|
||||||
|
|
@ -258,6 +259,7 @@ func newStatus() Status {
|
||||||
NewColor: "lightskyblue",
|
NewColor: "lightskyblue",
|
||||||
ModifyColor: "greenyellow",
|
ModifyColor: "greenyellow",
|
||||||
AddColor: "dodgerblue",
|
AddColor: "dodgerblue",
|
||||||
|
PendingColor: "darkorange",
|
||||||
ErrorColor: "orangered",
|
ErrorColor: "orangered",
|
||||||
HighlightColor: "aqua",
|
HighlightColor: "aqua",
|
||||||
KillColor: "mediumpurple",
|
KillColor: "mediumpurple",
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ var (
|
||||||
// AddColor row added color.
|
// AddColor row added color.
|
||||||
AddColor tcell.Color
|
AddColor tcell.Color
|
||||||
|
|
||||||
|
// PendingColor row added color.
|
||||||
|
PendingColor tcell.Color
|
||||||
|
|
||||||
// ErrColor row err color.
|
// ErrColor row err color.
|
||||||
ErrColor tcell.Color
|
ErrColor tcell.Color
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ func (c Container) ColorerFunc() ColorerFunc {
|
||||||
return DefaultColorer(ns, h, re)
|
return DefaultColorer(ns, h, re)
|
||||||
}
|
}
|
||||||
switch strings.TrimSpace(re.Row.Fields[stateCol]) {
|
switch strings.TrimSpace(re.Row.Fields[stateCol]) {
|
||||||
|
case Pending:
|
||||||
|
return PendingColor
|
||||||
case ContainerCreating, PodInitializing:
|
case ContainerCreating, PodInitializing:
|
||||||
return AddColor
|
return AddColor
|
||||||
case Terminating, Initialized:
|
case Terminating, Initialized:
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,8 @@ func (p Pod) ColorerFunc() ColorerFunc {
|
||||||
}
|
}
|
||||||
status := strings.TrimSpace(re.Row.Fields[statusCol])
|
status := strings.TrimSpace(re.Row.Fields[statusCol])
|
||||||
switch status {
|
switch status {
|
||||||
|
case Pending:
|
||||||
|
c = PendingColor
|
||||||
case ContainerCreating, PodInitializing:
|
case ContainerCreating, PodInitializing:
|
||||||
c = AddColor
|
c = AddColor
|
||||||
case Initialized:
|
case Initialized:
|
||||||
|
|
|
||||||
|
|
@ -23,6 +23,9 @@ const (
|
||||||
|
|
||||||
// PodInitializing represents a pod initializing status.
|
// PodInitializing represents a pod initializing status.
|
||||||
PodInitializing = "PodInitializing"
|
PodInitializing = "PodInitializing"
|
||||||
|
|
||||||
|
// Pending represents a pod pending status.
|
||||||
|
Pending = "Pending"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
|
|
||||||
|
|
@ -156,6 +156,7 @@ func (c *Configurator) updateStyles(f string) {
|
||||||
render.AddColor = c.Styles.Frame().Status.AddColor.Color()
|
render.AddColor = c.Styles.Frame().Status.AddColor.Color()
|
||||||
render.ErrColor = c.Styles.Frame().Status.ErrorColor.Color()
|
render.ErrColor = c.Styles.Frame().Status.ErrorColor.Color()
|
||||||
render.StdColor = c.Styles.Frame().Status.NewColor.Color()
|
render.StdColor = c.Styles.Frame().Status.NewColor.Color()
|
||||||
|
render.PendingColor = c.Styles.Frame().Status.PendingColor.Color()
|
||||||
render.HighlightColor = c.Styles.Frame().Status.HighlightColor.Color()
|
render.HighlightColor = c.Styles.Frame().Status.HighlightColor.Color()
|
||||||
render.KillColor = c.Styles.Frame().Status.KillColor.Color()
|
render.KillColor = c.Styles.Frame().Status.KillColor.Color()
|
||||||
render.CompletedColor = c.Styles.Frame().Status.CompletedColor.Color()
|
render.CompletedColor = c.Styles.Frame().Status.CompletedColor.Color()
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,14 @@
|
||||||
|
# $HOME/.k9s/plugin.yml
|
||||||
|
plugin:
|
||||||
|
# Issues a helm delete --purge for the resource associated with the selected pod
|
||||||
|
helm-purge:
|
||||||
|
shortCut: Ctrl-P
|
||||||
|
description: Helm Purge
|
||||||
|
scopes:
|
||||||
|
- po
|
||||||
|
command: kubectl
|
||||||
|
background: true
|
||||||
|
args:
|
||||||
|
- purge
|
||||||
|
- $NAMESPACE
|
||||||
|
- $NAME
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
#!/bin/bash
|
||||||
|
usage="kubectl $(basename "$0") [-h] NAMESPACE NAME
|
||||||
|
kubectl plugin, requires TILLER_NS set before call. Will run helm delete --purge on release associated with pod.
|
||||||
|
Release is acquired from the pod's 'describe' information in the 'tags' section.
|
||||||
|
Examples:
|
||||||
|
kubectl purge my-namespace my-namespace-pod1-123: Purge the release associated with 'my-namespace-pod1-123' pod"
|
||||||
|
while getopts ':h' option; do
|
||||||
|
case "$option" in
|
||||||
|
h) echo "$usage"
|
||||||
|
exit
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $((OPTIND -1))
|
||||||
|
|
||||||
|
namespace=$1
|
||||||
|
name=$2
|
||||||
|
if [ -z "$TILLER_NS" ]; then
|
||||||
|
echo "Set TILLER_NS environment variable before calling this function"
|
||||||
|
exit 1;
|
||||||
|
elif [ -z "$namespace" ]; then
|
||||||
|
echo "No Namespace provided"
|
||||||
|
exit 1;
|
||||||
|
elif [ -z "$name" ]; then
|
||||||
|
echo "No Name provided"
|
||||||
|
exit 1;
|
||||||
|
fi
|
||||||
|
|
||||||
|
kubectl describe pods -n $namespace $name | grep release | cut -f 2 -d'=' | xargs -J rel helm --tiller-namespace $TILLER_NS delete --purge rel
|
||||||
|
|
@ -23,6 +23,7 @@ k9s:
|
||||||
modifyColor: greenyellow
|
modifyColor: greenyellow
|
||||||
addColor: white
|
addColor: white
|
||||||
errorColor: orangered
|
errorColor: orangered
|
||||||
|
pendingColor: orangered
|
||||||
highlightcolor: aqua
|
highlightcolor: aqua
|
||||||
killColor: mediumpurple
|
killColor: mediumpurple
|
||||||
completedColor: gray
|
completedColor: gray
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue