Help us shape the future of Go! Take the 2026 Go Developer Survey

kubemrr

command module
v0.9.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

README

kubemrr

kubemrr mirrors description of Kubernetes resources for blazingly fast auto-completion.

Bash has the programmable completion feature which permits typing a partial command, then pressing the [TAB] key to auto-complete the command sequence.To use the feature, you need to write a completion script and place it in /etc/bash_completion.d folder (docs, tutorial). Fortunately, kubectl comes with a command to generate completion script (kubectl completion). The script works extremely well, but slow, because each time you hit [TAB] it sends a request to Kubernetes API Server. If your server is on a different continent you might wait for up to 2 seconds. To reduce the delay, kubemrr keeps names of resources locally. We will make a completion script which talks to kubemrr instead of real Kubernetes API server.

Example

To start watching a server:

kubemrr watch https://kube-us.example.org

To make completion script that talks to kubemrr:

alias kus='kubectl --context us'
kubemrr completion --kubectl-alias=kus > kus
sudo cp kus /etc/bash_completion.d

To test it:

kus get po [TAB][TAB]

To make completion script that talks to kubemrr that is running on different host (use IP to save time on name resolution):

kubemrr completion --address=10.5.1.6 --kubectl-alias=kus > kus

Autocompleted Resources

  • pods
  • service
  • deployments
  • configmaps

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL