Sign inSign up

anatolyrugalev/kubecom

By anatolyrugalev

•Updated about 6 years ago

kubecom: browse your Kubernetes cluster in a casual way

Image
0

948

anatolyrugalev/kubecom repository overview

⁠Kube Commander (kubecom)

Build Status Docker Image Aur

kubecom is an easy to use tool for observing Kubernetes cluster from your terminal.

Soon kube-commander will change its name to kubecom. Please don't mind some naming inconsistency - I'm trying to make the migration as seamless as possible.

Kubecom

⁠kubecom vs. kubernetes-dashboard comparison

kubecomkubernetes-dashboard
Easy to use:heavy_check_mark::heavy_check_mark:
Realtime data update:heavy_check_mark::heavy_multiplication_x:
Doesn't require deployment:heavy_check_mark::heavy_multiplication_x:
Doesn't require http access to cluster:heavy_check_mark::heavy_multiplication_x:
Can be used over SSH:heavy_check_mark::heavy_multiplication_x:
Responsiveness:zap::turtle:
Suitable for hackers:heavy_check_mark::heavy_multiplication_x:
Requires cluster-specific configuration:heavy_check_mark::heavy_check_mark:

⁠Requirements

  1. GNU/Linux, MacOS or Windows system
  2. kubectl⁠ installed and configured to access your cluster
  3. And... that's it!

⁠Installation

  1. Archlinux User Repository⁠
  2. Homebrew⁠
  3. Install binary⁠
  4. Install from sources⁠
  5. Run with Docker⁠
⁠AUR

If you use Archlinux you can install kubecom from AUR with your favorite AUR helper:

yay -S kube-commander
⁠Homebrew

To install kubecom with brew you first need to add a tap:

brew tap AnatolyRugalev/kubecom
brew install kubecom

Brew formula has both Linux and MacOS binaries.

⁠Binary

You can install kubecom from binary release for your OS. Linux, macOS and Windows are supported. You can find a package for your OS on this page⁠. Just download and put it to /usr/local/bin.

There's oneliner to download the latest binary for your OS to current directory:

curl -sL https://git.io/JUneH | bash
./kubecom --version
⁠Sources

If you have Go environment configured you can install kubecom easily with this command:

go get -u github.com/AnatolyRugalev/kube-commander/cmd/kubecom

NOTE: Make sure your $PATH has $GOPATH/bin in it.

⁠Run with Docker
alias kubecom="docker run --rm -v ~/.kube:/root/.kube -ti anatolyrugalev/kubecom:latest"
kubecom

⁠Usage

⁠Run

Before starting kubecom make sure you have proper kubectl configuration:

kubectl cluster-info

Then you can start kubecom:

kubecom

If you installed kubecom from AUR, you can start it with kubectl ui.

⁠Configure

You can easily configure kubecom with this options:

FlagEnv varDescription
configKUBECOMCONFIGPath to .kubecom.yaml
kubeconfigKUBECONFIGPath to kubeconfig
contextKUBECONTEXTContext name
namespaceKUBENAMESPACEInitial namespace to show
timeoutConnection timeout (default: "5s")
editorEDITORName of the editor binary. Default: "vi". But you probably already have one defined by your OS
pagerPAGERPager command for 'describe' command. Default: "less"
log-pagerLOGPAGERPager command for log output. Default: none
kubectlKUBECTLName of kubectl binary. Default: "kubectl"
tailKUBETAILNumber of log lines to show with kubectl logs. Default: 1000
klogKUBELOGKubernetes log file for debugging. Default: none

Example:

kubecom --context=my-cluster-2 --namespace=my-namespace --kubeconfig=~/.kube/my-config

Sometimes you want to colorify JSON logs, so here's useful --log-pager configuration for that:

kubecom --log-pager="jq -c -R -r '. as \$line | try fromjson catch \$line'"

You can pipe commands here as well:

kubecom --log-pager="jq -c | some_other_command"
⁠Configuration file

You can edit configuration file at ~/.kubecom.yaml to modify resource menu titles and themes. Usually you don't need to edit config manually: it updates automatically when you change resource menu items or switch theme. You can get familiar with configuration capabilities inspecting pb/config.proto⁠ protobuf file.

⁠Hotkeys

The first thing you need to press is "?". This will show help dialog in case you missed it on start screen.

Official Kubernetes Dashboard has a refresh key which updates items on page. With kubecom you don't have to do that: kubecom watches changes and updates screen in real time, so you can relax and take a sip of your fresh coffee while monitoring your deployment rolling out.

The most of hotkeys you can find on help dialog. Here they are:

KeyAction
?Show help dialog
↑↓→←Navigation. When table doesn't fit to the screen, use ← and → to scroll horizontally
EnterSelect menu item
Esc, BackspaceGo back
Q, Ctrl+CQuit
Ctrl+N, F2Switch namespace
F3(experimental) Show all known resources in resource menu
DDescribe selected resource with kubectl describe
EEdit selected resource with kubectl edit
DeleteDelete selected resource (then press "y" to confirm)
CCopy resource name to the clipboard
/Enter filtering mode. Type string and then press Enter to confirm
Ctrl+PSwitch to pods
Ctrl+DSwitch to deployments
Ctrl+ISwitch to ingresses
LShow pod logs
Shift+LShow previous pod logs
FForward pod port
SEnter to container /bin/sh shell
+ (plus)Add resource type to the menu
F6, F7Move resource type up/down in menu
F10, F11Cycle through themes

⁠Contribution

We play by gentleman rules. If you want to contribute a code - please file an issue describing your intentions first. This way we can avoid wasting time doing easy work the hard way. I'm always open to give my point of view on your ideas.

⁠Special thanks

Tag summary

Content type

Image

Digest

Size

35 MB

Last updated

about 6 years ago

docker pull anatolyrugalev/kubecom