+
Skip to content

faan11/voch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

voch logo

What is voch

voch is a minimal sh script that works around kubectl tool, that is:

  • Fast: one login and you are ready to go,
  • Simple: based on lightweight commands such as curl and yq,
  • Secure: voch downloads k8s configuration from bitwarden using cli and removes it afterwards,
  • Configurable: all clusters are defined in a yaml file similar to other tools,
  • Supported: voch supports any vanilla clusters
  • Easy: quick to install – start using it in minutes.
  • Interoperable: support for Mac and Linux operating systems

Authentication can be achieved through:

  • Bitwarden: the bitwarden client by looking at user and password in a strongbox entry.

Installation

Prerequisites

  • sh, used to execute the script
  • yq, used to manage yaml configuration (tested with v4.33.0)
  • kubectl, used to perform login and logout operation once received the token.
  • bw (bitwarden-cli, optional), used to request credentials
  • jq (optional), used to parse credentials json

Recommended software

  • starship, used to know the current kubectl context
  • kubectx, to change between kubectl context
  • kubens, to change the current namespace
  • fzf , to properly select the kubernetes context and namespace

Download and install

This script downloads and install the voch script in the bin directory of the user. You can also install system-wide.

curl -o voch https://raw.githubusercontent.com/faan11/voch/0.1.0/voch
mv voch $HOME/.local/bin/
chmod +x $HOME/.local/bin/voch

Usage

You can get the help command by simply typing

voch

The following command defines a cluster configuration.

voch define <profile-name> --context "$K8SContextName" --secrethandler "bitwarden" --secretname="$TheBitwardenSecretName"

Once the configuration is defined, the user can perform authentication by using the profile name.

Voch downloads the kubeconfig from Bitwarden and save it in the system. The command psh saves this kubeconfig in a temporary file. After that it opens a new shell with that kubeconfig, no one can access this skubeconfig. Once it is closed, the kubeconfig file will be removed from the system. A private shell can be created with the following command:

voch psh <context-name> 

The command login save this kubeconfig in $HOME/.kube/config.

voch login <context-name> 

The command logout removes the current kubeconfig. voch logout performs the logout operation.

voch logout

Autocompletion

voch supports only bash and zsh shell autocompletion. The autocompletion is limited to the login command. It is used to filter voch profiles.

eval "$(voch completion zsh)" # inside your .zshrc file
eval "$(voch completion bash)" # inside your .bashrc file

How to contribute

Feel free to open an issue in the repo and proposes new ideas.

Contributors

About

Vanilla k8s orientd cluster helpers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载