GithubHelp home page GithubHelp logo

derailed / k9s Goto Github PK

View Code? Open in Web Editor NEW
24.9K 24.9K 1.6K 63.82 MB

๐Ÿถ Kubernetes CLI To Manage Your Clusters In Style!

Home Page: https://k9scli.io

License: Apache License 2.0

Makefile 0.09% Go 99.77% Dockerfile 0.06% Shell 0.07%
go golang k8s k8s-cluster k9s kubernetes kubernetes-cli kubernetes-clusters

k9s's People

Contributors

ameausoone avatar bkmeneguello avatar brunohms avatar chenrui333 avatar davidnemec avatar dependabot[bot] avatar derailed avatar dramich avatar eciurleo avatar eiachh avatar eldada avatar fragolinux avatar fridokus avatar gberche-orange avatar groselt avatar joscha-alisch avatar mcristina422 avatar mikesigs avatar mycreepy avatar paivagustavo avatar raphink avatar raulcabello avatar rm-hull avatar sachaos avatar sagor999 avatar slimus avatar syvanpera avatar torjue avatar tyzbit avatar wjiec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

k9s's Issues

Problem with modifying filter phrase

There is a problem with Backspace during filtering - there is no possibility to edit filtering phrase by removing characters. I can only add characters to existing phrase.
Pressing Esc to clear filtering and writting phrase from beginning is sometimes frustrating...
image

alias not responding

Version: 0.1.3
Platform: RHEL 7.6 (AWS)

I see this has come up before (#40) and that you had said that it is now necessary to type the > character first. However I still don't seem to be able to get that to work. So that I'm not missing something. Lets say I am looking at services accounts and I want to switch to pods, do I type ...

>po<return>

i.e. the character '>' followed by 'po' then the RETURN key.

That doesn't work for me.

Pressing ? and selecting using the arrow keys does, but ...

What am I missing ?

DELETE KEY !!!!!

please remove the shortcut key from the backspace key, control + d was better.

Default Log Location Prevents Multi-User Use

We like to restrict network access to the kube API, so we have k9s installed on a management server. Unfortunately, due to the location of the log file (/tmp/k9s.log), k9s will only work for the first person who runs it. Subsequent users will receive a permission denied error like this:

$ k9s
panic: open /tmp/k9s.log: permission denied

goroutine 1 [running]:
main.init.0()
	/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/main.go:15 +0xcc

Perhaps the log file should be user-specific? If so, it could either live in the user's home directory (~/.k96/logs ?) or in /tmp/k9s-username.log

Or maybe use syslog instead.

Support filtering in Alias dashboard

The alias dashboard doesnt support filtering and requires the need to scroll through each entry to find the right resource. This gets harder when you have multiple CRDs and APIGroups (ex. istio).

Would be great to have the / option in every dashboard for that matter.

Expand to see containers in pods

Hi !

I would like to propose an enhancement, unless this is already implemented ๐Ÿ™ˆ.

When browsing pods, I would like to be able to hit and expand the containers within that pod.

For example:

Namespace Name Read....
foo bar 2/2
-> container_A
-> container_B

what do you think ?

If you like this idea i might be able to help !

Feature Request: Filter results

Most of the time I al looking for a specific resource, and since we name ours in such a way, that when using kubectl, I can just grep for the resources I need. For instance kubectl get all -n my-namespace | grep my-app. It would be awesome to be able to filter, and keep that filter as you bounce between resource type views.

panic does not display the actual error

Running k9s I just get

$k9s
panic: (*logrus.Entry) (0x1e88f20,0xc000210cc0)

goroutine 1 [running]:
github.com/derailed/k9s/vendor/github.com/sirupsen/logrus.Entry.log(0xc0000d0480, 0xc000515cb0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/vendor/github.com/sirupsen/logrus/entry.go:216 +0x2cf
github.com/derailed/k9s/vendor/github.com/sirupsen/logrus.(*Entry).Panic(0xc000210c60, 0xc000579c88, 0x1, 0x1)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/vendor/github.com/sirupsen/logrus/entry.go:290 +0xab
github.com/derailed/k9s/vendor/github.com/sirupsen/logrus.(*Logger).Panic(0xc0000d0480, 0xc000579c88, 0x1, 0x1)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/vendor/github.com/sirupsen/logrus/logger.go:271 +0x6d
github.com/derailed/k9s/vendor/github.com/sirupsen/logrus.Panic(0xc000579c88, 0x1, 0x1)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/vendor/github.com/sirupsen/logrus/exported.go:123 +0x4b
github.com/derailed/k9s/views.(*appView).Run(0xc0001186e0)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/views/app.go:108 +0xad
github.com/derailed/k9s/cmd.run(0x2aa0840, 0x2ac8a48, 0x0, 0x0)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/cmd/root.go:70 +0xa6
github.com/derailed/k9s/vendor/github.com/spf13/cobra.(*Command).execute(0x2aa0840, 0xc0000b8170, 0x0, 0x0, 0x2aa0840, 0xc0000b8170)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/vendor/github.com/spf13/cobra/command.go:766 +0x2cc
github.com/derailed/k9s/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x2aa0840, 0xc0000ce760, 0x209, 0xc00016df88)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/derailed/k9s/vendor/github.com/spf13/cobra.(*Command).Execute(0x2aa0840, 0x1eb66c9, 0x4)
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/vendor/github.com/spf13/cobra/command.go:800 +0x2b
github.com/derailed/k9s/cmd.Execute()
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/cmd/root.go:59 +0x2d
main.main()
	/Users/csanchez/dev/golang/src/github.com/derailed/k9s/main.go:21 +0x20

digging a bit the actual error is terminal entry not found
I'm using iterm2 and based on some internet search I managed to make it work with TERM=xterm-256color k9s

Feature Request: Support for viewing all resources

Many times when viewing resources, issues with one are underlined by issues in another one. I constantly find myself using kubectl get all first and then drilling down. It would be nice to have that here.

Is there a way to scroll when in log view?

When I open the logs of a pod, there is no way to scroll up or down. Is this intended? If so, I think it would be a nice feature to add the ability to scroll during log tail like you normally would.

Feature request: more ergonomic hotkeys

Would it be possible to change hotkeys like CTRL-E to simply e? It would be easier to type.

CTRL-B in particular is problematic if you use tmux, since that's the default tmux prefix. It would be awesome if instead of CTRL-B you could just type q or ESC to go back a screen (rather than exit the whole app).

FYI htop has nicely designed hotkeys.

No output is displayed when failing

Due to a setup that k9s is unhappy with (kubeconfig outside of normal location) k9s quits upon start which is expected the only issue is no error or warning is printed back to console.

Rework key mappings

My proposal would be to stick to vi-style key mappings for navigation and modification. For example for basic up/down movement CTRL-F/B and CTRL-D/U. WDYT?

what is ctrl-space supposed to do ?

ctrl-space goes to viewing all namespaces... isn't it supposed to go to a tools option ?
also, ? or h is not doing anything.

built from master on OSx

Syntax Error near unexpected token

Version: 0.1.2
Platform: RHEL 7.6 (AWS)

Error on start ...

[ec2-user@ip-xx-xx-xxx-xxx~]$ k9s
/usr/local/bin/k9s: line 5: syntax error near unexpected token ]' /usr/local/bin/k9s: line 5: } ]'

Support /bin/bash as an SSH command

podView.sshIntocalls "sh" directly.

Generally, I prefer /bin/bash since it supports tab auto-completion.

Should be simple to change, but I'm not sure the best way to store the configuration preference. Maybe this issue is really to store configuration.

Feature Request: Quick Scale

I would love to see a quick scale feature, where you can scale a deployment without having to edit the deployment. Like kubectl scale --replicas x service-name.

Just a couple features like this, and k9s could replace kubectl for me.

Remember deleted pod table location

Upon deleting a pod the row selector moves to the top of the table which is column names. That is a pain when we have to delete multiple pods.

Can we also support deleting multiple and all pods in a namespace. Pretty useful when you want to just restart everything one is working on. Should translate to something kubectl -n some_namespace delete pod --all and kubectl -n some_namespace delete pod some_pod_1 some_pod_2.

This in general can be mapped to any k8s resource rather than just pods.

Supported environment on README?

It seems that macOS is only supported based on the Makefile so far.
Are you planning to support Linux as well? :)

Also it'd be nice if you have supported environment with go version and necessary libraries if there's any.

Exception when trying to switch to an already active context

When trying to switch to an already active context (the one with the trailing star) the application crashes. Most probably because it advices the K8s API to use the star as part of the context name:

panic: invalid configuration: [context was not found for specified context: ambid-stg-app-admin*, cluster has no server defined] [recovered]
	panic: invalid configuration: [context was not found for specified context: ambid-stg-app-admin*, cluster has no server defined]

goroutine 1 [running]:
github.com/k8sland/tview.(*Application).Run.func1(0xc00013dd60)
	/Users/fernand/go_wk/derailed/pkg/mod/github.com/k8sland/[email protected]/application.go:167 +0x8b
panic(0x1d88c00, 0xc00053e940)
	/usr/local/Cellar/go/1.11.5/libexec/src/runtime/panic.go:513 +0x1b9
github.com/derailed/k9s/resource/k8s.(*apiServer).restConfigOrDie(0xc00020ef60, 0x1085aa9)
	/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/resource/k8s/api.go:207 +0x7e
github.com/derailed/k9s/resource/k8s.(*apiServer).dialOrDie(0xc00020ef60, 0x1085845, 0x0)
	/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/resource/k8s/api.go:96 +0x49
github.com/derailed/k9s/resource/k8s.(*apiServer).supportsMxServer(0xc00020ef60, 0xc0000da720)
	/Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/resource/k8s/api.go:238 +0x43

Ask for confirmation before deletion

Probably it's my particular keyboard, but D and E are so close that sometimes I hit D instead of E when editing a deployment... and there it goes!
Would it be possible to ask for user confirmation before deleting a resource? (could be a config toggle)

UX request: Deletion of pods during search

Hey :)

thanks for your tool! - Love it.

Can I pr to change the key binding of deletion of a pod? - Maybe to CTRL + 'backspace'?

I just search with '/' for pods and then wanted to change the search and immediately pressed 'backspace' which resulted in deletion of the pod. This was unexpected.

Greetings, Thomas

Missing namespaces in selection v. 0.1.1

K9s 0.1.1 is not allowing selection of namespaces outside of all, default and kube-system which was possible in 0.1.0.

First noticed on a GKE cluster running 1.12.4-gke.6, reproduced on a local minikube instance.

Reproduce

Have minikube, kubectl and k9s installed.

$ minikube delete
$ minikube start
$ kubectl apply -f https://k8s.io/examples/admin/namespace-dev.json

Running

$ kubectl get namespaces

Returns

NAME          STATUS   AGE
default       Active   xxx
development   Active   xxx
kube-public   Active   xxx
kube-system   Active   xxx

Launching k9s you can only see

<0> all
<1> default
<2> kube-system

Openshift?

Hi,

Have you any plans to support openshift, i.e. "oc" as opposed to kubectl commands?

Missing ip addresses in external IP

I run kubernetes with rancher on a local datacenter. I use metalLB for loadbalancing

kubectl shows the ip address of a service managed by metallb,

kubectl get services --all-namespaces

NAMESPACE    NAME    TYPE          CLUSTER-IP       EXTERNAL-IP    PORT(S)
foo          foo    LoadBalancer   10.251.79.248    10.47.92.5    6543:32169/TCP
bar          bar    LoadBalancer   10.252.8.197     10.47.92.3    3000:31726/TCP 

Yet in k9s, it shows the external ip as pending

โ”‚ NAMESPACE   NAME   TYPE            CLUSTER-IP        EXTERNAL-IP    PORT(S)    AGE    โ”‚
โ”‚ foo         foo     LoadBalancer    10.251.79.248    <pending>    6543โ–บ32169    19h           โ”‚
โ”‚ bar         bar     LoadBalancer    10.252.8.197     <pending>    3000โ–บ31726    25h

Feature request: installation/upgrade via go get -u

I would like to be able to update to the latest version by just doing:
go get -u github.com/derailed/k9s

If I do so today, I get the following errors (ubuntu 18.04 LTS, go version go1.11.5 linux/amd64):

$ go get -u github.com/derailed/k9s
# github.com/derailed/k9s/vendor/cloud.google.com/go/compute/metadata
workspace/go/src/github.com/derailed/k9s/vendor/cloud.google.com/go/compute/metadata/metadata.go:453:21: undefined: resource
# github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:872:28: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:907:37: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:910:53: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1012:67: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1119:38: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1122:54: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1342:48: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1398:37: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1401:53: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1624:48: undefined: resource
workspace/go/src/github.com/derailed/k9s/vendor/github.com/googleapis/gnostic/OpenAPIv2/OpenAPIv2.go:1624:48: too many errors
# github.com/derailed/k9s/vendor/k8s.io/apimachinery/pkg/apis/meta/v1
workspace/go/src/github.com/derailed/k9s/vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types.go:277:29: undefined: resource

Thank you for your awesome work!

Quick sorting/filtering

Would be very nice to be able to sort the listing based on arbitrary columns - maybe by selecting the header row, [left]/[right] to select column, and [enter] to sort ascending or descending.

Similarly, perhaps one could select a column then hit [/] and get a little prompt for a regex to filter the column against.

Great project!

Problem with switching between resources

There is a problem with switching between resources from list. It wants to switch to APIGROUP instead of ALIAS.

It occurs when I press 'End' to get end of list, select any resource and press 'Enter'.
When I scroll down by arrow key or PageDown - it works fine

image

exception while getting hpa

i do not have the exception anymore but k9s crashed when i filtered on HPA types (Horizontal Pod Autoscaler).

I have removed my hpa but still thought i d report it.
good job on k9s, it makes things easier :)

Limit available namespaces

Having the ability to limit the application to specific namespaces - perhaps via a ~/.k9s/config file - would be great.

See previous container logs

Would be nice to support last container exited logs, usually available through kubectl logs <pod_name> -p

k9s won't start for users who can't query all namespaces even when using -n

I work with a cluster that uses RBAC to limit non-administrative users to specific namespaces and as such I don't have permission to list all of the available namespaces. I was hoping that the -n option might allow me to use k9s but even with this option I'm getting the following error on start:

> ./k9s -n my-namespace
panic: namespaces is forbidden: User "[email protected]" cannot list resource "namespaces" in API group "" at the cluster scope

goroutine 1 [running]:
github.com/derailed/k9s/views.mustK8s()
        /Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/views/app.go:119 +0xc2
github.com/derailed/k9s/views.(*appView).Init(0xc0000ffd40, 0x1407c74, 0x5, 0x2, 0x7fffbfcb96f7, 0x6)
        /Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/views/app.go:74 +0xb0
github.com/derailed/k9s/cmd.run(0x1dfb940, 0xc00017b200, 0x0, 0x2)
        /Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:109 +0xfd
github.com/spf13/cobra.(*Command).execute(0x1dfb940, 0xc0000380a0, 0x2, 0x2, 0x1dfb940, 0xc0000380a0)
        /Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:766 +0x2cc
github.com/spf13/cobra.(*Command).ExecuteC(0x1dfb940, 0xc00000c788, 0xc0000b3f78, 0xc0000b3f88)
        /Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:852 +0x2fd
github.com/spf13/cobra.(*Command).Execute(0x1dfb940, 0xc0000001a4, 0xc00000c788)
        /Users/fernand/go_wk/derailed/pkg/mod/github.com/spf13/[email protected]/command.go:800 +0x2b
github.com/derailed/k9s/cmd.Execute()
        /Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/cmd/root.go:91 +0x2d
main.main()
        /Users/fernand/go_wk/derailed/src/github.com/derailed/k9s/main.go:22 +0x20

Bug: Default context cluster name displayed when running with different context

Firstly, thanks for creating k9s. Although I have had a few issues whilst playing with it, I am very thankful for what you've created.

Steps to reproduce:

Note: you need more than 1 context available (2 different clusters) in your list of contexts. For example serverA/foo & serverB/bar

  1. Use kubectl to set your current context, eg:
 kubectl config serverA/foo
  1. Start k9s with the --context flag pointing to the other context, eg:
 k9s --context serverB/bar
  1. When the view is initialised the ClusterName in the top left will be that of the current kubectl context, not the context passed to k9s

Feature Request: cronjob trigger

It would be create to have a Trigger keybinding for cronjobs, much like the Kubernetes Dashboard has.

Also: thanks for this, this is a great tool. We'd love to help with building this out.

Aliases do not work

Aliases to switch between resources do not work, i.e. when I type cm or dp or hpa nothing happens although they work over menu Ctrl+A
Terminal Emulator iTerm2 Build 3.2.7
MacOS Mojave 10.14.2

Procedures to fork k9s on GitHub

This is probably not a k9s specific issue, but I'm not sure how to fork the code on GitHub.

With packages using Gopkg.toml, I could set up a specific source to use my local code without editing all the imports. But I'm not sure how to do with with Go modules.

Thanks!

Feature Request: Support for OIDC auth type

Hey there!
k9s was crashing on startup, and checking the log at /tmp/k9s.log it says:

time="2019-02-04T11:23:50Z" level=fatal msg="No Auth Provider found for name \"oidc\""

Probably because k9s doesn't support the oidc auth method perhaps?

Logo needs new glasses

A small improvement could be made to the logo by making the Kubernetes glasses smoother โœจ

screenshot 2019-02-05 at 11 12 18

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.