From 712948417e5f9252f31cfe6e4028fdcc8906f7c3 Mon Sep 17 00:00:00 2001 From: derailed Date: Fri, 1 Feb 2019 17:59:56 -0700 Subject: [PATCH] documentation + graphics updates --- README.md | 27 +++++++++++---------------- resource/svc.go | 16 +++++++--------- views/app.go | 4 ++-- views/splash.go | 34 ++++++++++++---------------------- 4 files changed, 32 insertions(+), 49 deletions(-) diff --git a/README.md b/README.md index f0130061..7397b81b 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# 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.
@@ -33,27 +33,22 @@ brew install k9s - [Releases](https://github.com/derailed/k9s/releases) -
--- -## Features +## Commands -> Note: k9s does not have an idiot light. Please be sure to hit the correct command -> sequences to avoid pilot errors. `Are you sure?` not in effect here... - -+ k9s uses 2 or 3 letters alias to navigate most Kubernetes resources ++ K9s uses 2 or 3 letters alias to navigate most K8s resource + At any time you can use `?` to look up the various commands + Use `alias` 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 ... -+ Use `ctx` to see and switch between your clusters ++ Use `ctx` to switch between clusters ++ Use `Q` or `Ctrl-C` to Quit.
--- -## Video Demo +## Demo Video + [k9s Demo](https://youtu.be/k7zseUhaXeU) diff --git a/resource/svc.go b/resource/svc.go index defac178..96585c83 100644 --- a/resource/svc.go +++ b/resource/svc.go @@ -8,7 +8,7 @@ import ( "github.com/derailed/k9s/resource/k8s" log "github.com/sirupsen/logrus" yaml "gopkg.in/yaml.v2" - "k8s.io/api/core/v1" + v1 "k8s.io/api/core/v1" ) // Service tracks a kubernetes resource. @@ -89,7 +89,6 @@ func (*Service) Header(ns string) Row { "TYPE", "CLUSTER-IP", "EXTERNAL-IP", - "SELECTOR", "PORT(S)", "AGE", ) @@ -109,7 +108,6 @@ func (r *Service) Fields(ns string) Row { string(i.Spec.Type), i.Spec.ClusterIP, r.toIPs(i.Spec.Type, i.Spec.ExternalIPs), - mapToStr(i.Spec.Selector), r.toPorts(i.Spec.Ports), toAge(i.ObjectMeta.CreationTimestamp), ) @@ -140,11 +138,11 @@ func (*Service) toPorts(pp []v1.ServicePort) string { ports[i] = p.Name + ":" } ports[i] += strconv.Itoa(int(p.Port)) + - "->" + - strconv.Itoa(int(p.NodePort)) + - "/" + - string(p.Protocol) - + "►" + + strconv.Itoa(int(p.NodePort)) + if p.Protocol != "TCP" { + ports[i] += "╱" + string(p.Protocol) + } } - return strings.Join(ports, ",") + return strings.Join(ports, " ") } diff --git a/views/app.go b/views/app.go index 28b1bbe0..62055748 100644 --- a/views/app.go +++ b/views/app.go @@ -79,13 +79,13 @@ func (a *appView) Init() { header.SetDirection(tview.FlexColumn) header.AddItem(a.infoView, 25, 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.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.flashView, 1, 1, false) } diff --git a/views/splash.go b/views/splash.go index b3f653ac..b838571f 100644 --- a/views/splash.go +++ b/views/splash.go @@ -14,31 +14,21 @@ const ( ) var logoSmall = []string{ - - ` __ ______ `, - `| | __/ __ \ ______`, - `| |/ /> < / ___/`, - `| `, - ` \/ \/ \/ `, + ` ____ __.________ `, + `| |/ _/ __ \______`, + `| < \____ / ___/`, + `| | \ / /\___ \ `, + `|____|__ \ /____//____ >`, + ` \/ \/ `, } var logo = []string{ - ` ____ __. ______ _________ .___`, - `| |/ _|/ __ \ _____\_ ___ \ _____ __| _/`, - `| < > < / ___/ \ \/ / \ / __ | `, - `| | \/ -- \\___ \\ \___| Y Y \/ /_/ | `, - `|____|__ \______ /____ >\______ /__|_| /\____ | `, - ` \/ \/ \/ \/ \/ \/ `, -} - -var co = []string{ - `.__ .__ __ .__ `, - `|__| _____ | |__ _____/ |_ ____ ______ |__| ____ `, - `| |/ \| | \ / _ \ ___/ __ \\____ \ | |/ _ \ `, - `| | Y Y | Y ( <_> | | \ ___/| |_> > | ( <_> )`, - `|__|__|_| |___| /\____/|__| \___ | __/ /\ |__|\____/ `, - ` \/ \/ \/|__| \/ `, + ` ____ __.________ _________ .____ .___ `, + `| |/ _/ __ \_____\_ ___ \| | | |`, + `| < \____ / ___/ \ \/| | | |`, + `| | \ / /\___ \\ \___| |___| |`, + `|____|__ \ /____//____ >\______ /_______ \___|`, + ` \/ \/ \/ \/ `, } // Splash screen definition