documentation + graphics updates

mine
derailed 2019-02-01 17:59:56 -07:00
parent ae6d339765
commit 712948417e
4 changed files with 32 additions and 49 deletions

View File

@ -1,12 +1,12 @@
<img src="assets/k9s.png"> <img src="assets/k9s.png">
# K9s - CLI to manage your Kubernetes clusters. # K9s - Kubernetes CLI To Manage Your Clusters In Style!
K9s provides a curses based terminal UI to interact with your Kubernetes clusters.
The aim of this project is to make it easier to navigate, observe and manage
your applications. This command line app continually watches Kubernetes
for changes and offers subsequent commands to interact with observed resources.
K9s is written in GO and provides a graphical terminal UI to interact with your
Kubernetes clusters. The aim of this project is to make it easier to navigate,
observe and manage your clusters. The CLI continually watches Kubernetes
resources for changes and offers subsequent commands to interact with the
observed resource.
<br/> <br/>
@ -33,27 +33,22 @@ brew install k9s
- [Releases](https://github.com/derailed/k9s/releases) - [Releases](https://github.com/derailed/k9s/releases)
<br/> <br/>
--- ---
## Features ## Commands
> Note: k9s does not have an idiot light. Please be sure to hit the correct command + K9s uses 2 or 3 letters alias to navigate most K8s resource
> sequences to avoid pilot errors. `Are you sure?` not in effect here...
+ k9s uses 2 or 3 letters alias to navigate most Kubernetes resources
+ At any time you can use `?<Enter>` to look up the various commands + At any time you can use `?<Enter>` to look up the various commands
+ Use `alias<Enter>` to activate a resource under that alias + Use `alias<Enter>` to activate a resource under that alias
+ Use `Esc` to erase previous keystrokes.
+ Use `Q` or `Ctrl-C` to Quit.
+ `Ctrl` sequences are used to view, edit, delete, ssh ... + `Ctrl` sequences are used to view, edit, delete, ssh ...
+ Use `ctx<Enter>` to see and switch between your clusters + Use `ctx<Enter>` to switch between clusters
+ Use `Q` or `Ctrl-C` to Quit.
<br/> <br/>
--- ---
## Video Demo ## Demo Video
+ [k9s Demo](https://youtu.be/k7zseUhaXeU) + [k9s Demo](https://youtu.be/k7zseUhaXeU)

View File

@ -8,7 +8,7 @@ import (
"github.com/derailed/k9s/resource/k8s" "github.com/derailed/k9s/resource/k8s"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
yaml "gopkg.in/yaml.v2" yaml "gopkg.in/yaml.v2"
"k8s.io/api/core/v1" v1 "k8s.io/api/core/v1"
) )
// Service tracks a kubernetes resource. // Service tracks a kubernetes resource.
@ -89,7 +89,6 @@ func (*Service) Header(ns string) Row {
"TYPE", "TYPE",
"CLUSTER-IP", "CLUSTER-IP",
"EXTERNAL-IP", "EXTERNAL-IP",
"SELECTOR",
"PORT(S)", "PORT(S)",
"AGE", "AGE",
) )
@ -109,7 +108,6 @@ func (r *Service) Fields(ns string) Row {
string(i.Spec.Type), string(i.Spec.Type),
i.Spec.ClusterIP, i.Spec.ClusterIP,
r.toIPs(i.Spec.Type, i.Spec.ExternalIPs), r.toIPs(i.Spec.Type, i.Spec.ExternalIPs),
mapToStr(i.Spec.Selector),
r.toPorts(i.Spec.Ports), r.toPorts(i.Spec.Ports),
toAge(i.ObjectMeta.CreationTimestamp), toAge(i.ObjectMeta.CreationTimestamp),
) )
@ -140,11 +138,11 @@ func (*Service) toPorts(pp []v1.ServicePort) string {
ports[i] = p.Name + ":" ports[i] = p.Name + ":"
} }
ports[i] += strconv.Itoa(int(p.Port)) + ports[i] += strconv.Itoa(int(p.Port)) +
"->" + "" +
strconv.Itoa(int(p.NodePort)) + strconv.Itoa(int(p.NodePort))
"/" + if p.Protocol != "TCP" {
string(p.Protocol) ports[i] += "" + string(p.Protocol)
}
} }
return strings.Join(ports, ",") return strings.Join(ports, " ")
} }

View File

@ -79,13 +79,13 @@ func (a *appView) Init() {
header.SetDirection(tview.FlexColumn) header.SetDirection(tview.FlexColumn)
header.AddItem(a.infoView, 25, 1, false) header.AddItem(a.infoView, 25, 1, false)
header.AddItem(a.menuView, 0, 1, false) header.AddItem(a.menuView, 0, 1, false)
header.AddItem(logoView(), 25, 1, false) header.AddItem(logoView(), 26, 1, false)
} }
main := tview.NewFlex() main := tview.NewFlex()
{ {
main.SetDirection(tview.FlexRow) main.SetDirection(tview.FlexRow)
main.AddItem(header, 6, 1, false) main.AddItem(header, 7, 1, false)
main.AddItem(a.content, 0, 10, true) main.AddItem(a.content, 0, 10, true)
main.AddItem(a.flashView, 1, 1, false) main.AddItem(a.flashView, 1, 1, false)
} }

View File

@ -14,31 +14,21 @@ const (
) )
var logoSmall = []string{ var logoSmall = []string{
` ____ __.________ `,
` __ ______ `, `| |/ _/ __ \______`,
`| | __/ __ \ ______`, `| < \____ / ___/`,
`| |/ /> < / ___/`, `| | \ / /\___ \ `,
`| </ -- \\___ \ `, `|____|__ \ /____//____ >`,
`|__|_ \______ /____ >`, ` \/ \/ `,
` \/ \/ \/ `,
} }
var logo = []string{ var logo = []string{
` ____ __. ______ _________ .___`, ` ____ __.________ _________ .____ .___ `,
`| |/ _|/ __ \ _____\_ ___ \ _____ __| _/`, `| |/ _/ __ \_____\_ ___ \| | | |`,
`| < > < / ___/ \ \/ / \ / __ | `, `| < \____ / ___/ \ \/| | | |`,
`| | \/ -- \\___ \\ \___| Y Y \/ /_/ | `, `| | \ / /\___ \\ \___| |___| |`,
`|____|__ \______ /____ >\______ /__|_| /\____ | `, `|____|__ \ /____//____ >\______ /_______ \___|`,
` \/ \/ \/ \/ \/ \/ `, ` \/ \/ \/ \/ `,
}
var co = []string{
`.__ .__ __ .__ `,
`|__| _____ | |__ _____/ |_ ____ ______ |__| ____ `,
`| |/ \| | \ / _ \ ___/ __ \\____ \ | |/ _ \ `,
`| | Y Y | Y ( <_> | | \ ___/| |_> > | ( <_> )`,
`|__|__|_| |___| /\____/|__| \___ | __/ /\ |__|\____/ `,
` \/ \/ \/|__| \/ `,
} }
// Splash screen definition // Splash screen definition