Code Monkey home page Code Monkey logo

k9s's Introduction

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.



Go Report Card Build Status



Installation

  1. Homebrew (OSX)
brew tap derailed/k9s && brew install k9s
  1. Binary Releases


Command Line

# List all available CLI options
k9s -h
# To get info about K9s runtime (logs, configs, etc..)
k9s config
# To run K9s in a given namespace
k9s -n mybitchns


PreFlight Checks

  • K9s uses 256 colors terminal mode. On `Nix system make sure TERM is set accordingly.

    export TERM=xterm-256color
  • For clusters with many namespaces you can either edit ~/.k9s/config.yml or go to the namespace(ns) view to switch your default namespace to your namespace of choice using Ctrl-Switch. K9s keeps your top 10 favorite namespaces. Namespaces will get evicted from the top 10 list, based on your namespace switching frequency.

    k9s:
      refreshRate:   5   # K9s refresh rate in secs
      logBufferSize: 200 # Size of the logs buffer. Try to keep a sensible default!
      namespace:
        active: myCoolNS # Current active namespace name
        favorites:       # List of your 10 most frequently used namespaces
        - myCoolNS1
        - myCoolNS2
        - all
        - default
        - kube-system
      view:
        active: po       # Active resource view
  • K9s can use $KUBECONFIG env var to load cluster information. However we've seen hill effects of using this env with multiple files as setting the current context may not update the correct file when using this technique.




Usage

K9s uses 2 or 3 letters alias to navigate most K8s resource.

Command Result Example
>alias<ENTER> List a Kubernetes resource in the active namespace >po<ENTER>
Ctrl-A Show all command aliases
/filterENTER> Filter out a resource view given a filter /bumblebeetuna
<Esc> Bails out of command mode
Ctrl-Key Key mapping to view, edit, see logs, etc... Ctrl-L (view logs)
>ctx<ENTER> To view and switch to another Kubernetes cluster
Ctrl-q, Ctrl-c To bail out of K9s


Building From Source

K9s was built using go 1.11. In order to build K9 from source:

  • Clone the repo
  • Add the following command in your go.mod file
    replace (
      github.com/derailed/k9s => MY_K9S_CLONED_REPO
    )
    
  • Build and run the executable
    go run main.go


Demo Video



Screen Shots

Pod View

Log View



Known Issues...

This initial drop is brittle. K9s will most likely blow up if...

  • K9s does not support multiple cluster config specified via KUBECONFIG env var
  • You don't have enough RBAC fu to manage your cluster
  • Your cluster does not run a metrics-server


Disclaimer

This is still work in progress! If there is enough interest in the Kubernetes community, we will enhance per your recommendations/contributions. Also if you dig this effort, please let us know that too!



ATTA Girls/Boys!

K9s sits on top of many of opensource projects and libraries. Our sincere appreciations to all the OSS contributors that work nights and weekends to make this project a reality!



Contact Information



ยฉ 2018 Imhotep Software LLC. All materials licensed under Apache v2.0

k9s's People

Contributors

derailed avatar saromanov avatar

Watchers

James Cloos avatar Humdan avatar

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.