Giter VIP home page Giter VIP logo

kgv's Introduction

KGV

Rust MIT licensed

KGV is Kubernetes Global View or an acronym for GVK. It's a Terminal UI for observing and manipulating Kubernetes resources.

Features

  1. rhai-based data extraction for table views. Write a small script to extract the data for each column for a given GVK. Data extraction is parallel.
  2. Rhai module support. Use imports and reuse the code.
  3. Detail view templates are defined as Handlebars HTML templates, rendered against the resource context, and then converted to ASCII using cursive-markup.
  4. Live reloading support for the rhai engine and templates.
  5. Live updates for the detail, YAML, and list views.
  6. Collecting initial GVK resource names is cached. Startup on overprovisioned or overloaded k8s installations is faster.
  7. Multiple window support. Open multiple windows (logs, list views, list details views, or just details views) and switch between them. Switching is instant.
  8. Custom user dirs support. Specify your modules and templates dirs with CMD arguments.

Screenshots

Table View: Pods Table View: Pod Containers Handlebars HTML Detail View YAML View Window Switcher View GVK Switcher View Logs View Menu Port Forwarding Dialog Port Forwarding View

Minor features

  • Rhai debugs are transferred to the main debug window
  • Handlebars template includes and inheritance support
  • YAML partial code extractors for Handlebars (use to_yaml helper)

Hotkeys

  • ~: Show Debug Console
  • Esc: Close the current window
  • Ctrl+s: execute kubectl exec -it
  • Alt+=: Show windows view
  • Ctrl+p: Dump rhai object to temp
  • F5: Refresh the view (clears deleted items)
  • Ctrl+y: Show Resource YAML view
  • Ctrl+/: Show a list of registered GVKs
  • Ctrl+k: Delete current selected resource
  • Ctrl+l: Show logs for the selected resource
  • Ctrl+f: Show Port Forwarding dialog for the selected pod
  • Ctrl+g: Show active Port Forwards

Run

RUST_BACKTRACE=1 cargo run -- --module-dirs ./default_config/modules --extractor-dirs ./default_config/views/list  --detail-template-dirs ./default_config/views/detail

Adding new Resource / GVK support

  1. Describe the Resource List view YAML. Top-level sections are:
    • resource: there you describe Group, Version, Kind
    • imports: automatically prepend for each column evaluator script these lines
    • pseudo_resources: an extractor for nested resource list (return a list of PseudoResource items; for Pod pseudo-resource is a container)
    • events: show either a pseudo resource table or an HTML detail template
    • columns: a list of column evaluators with column names
    • details: for HTML-based views specify a root template and rhai helpers
  2. If you need an HTML detail view, describe templates. Includes and template inheritance is supported.
  3. When writing column evaluators, use Ctrl+P hotkey to extract currently selected resource as a rhai object.

TODO

  • Resource multiselect (i.e., to delete multiple resources at once)
  • Resource kill options support
  • Faster Log view
  • Better shell selector (now it uses sh always)
  • Port Forwarding
  • Configurable hotkeys
  • rhai-based context extractors for rendering with support for multiple resources (when you need to solve N+1 problem for resource detail view and show some dependencies)
  • Log mirroring to a file
  • Prepare more detail and list views for more GVKs
  • Support for popular CRDs (helm, GitOps, etc)
  • Solve a problem with panics handler breaking the terminal

kgv's People

Contributors

night-crawler avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kgv's Issues

Azure login support

Hello, just tried your tool, but had this error:

Error: auth error: failed exec auth: The azure auth plugin is not supported; use https://github.com/Azure/kubelogin instead

Caused by:
    failed exec auth: The azure auth plugin is not supported; use https://github.com/Azure/kubelogin instead

I guess it's not usable for Azure yet?

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.