Skip to content

A ZSH plugin to ensure the --context flag is passed to kubectl.

License

Notifications You must be signed in to change notification settings

do-i-need-a-username/ensure-kube-context

Repository files navigation

ensure-kube-context

A ZSH plugin to ensure the --context flag is passed to various Kubernetes commands like kubectl, cilium, stern, and more.

Install

Oh My Zsh

  1. Clone the repository:
git clone --depth=1 https://github.com/do-i-need-a-username/ensure-kube-context.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/plugins/ensure-kube-context
  1. Configure your .zshrc:

Open ~/.zshrc and set ENSURE_KUBE_CONTEXT_MODULES to a list of commands you want to enforce the --context flag on.

# .zshrc
ENSURE_KUBE_CONTEXT_MODULES=(kubectl cilium stern helm kustomize)
  1. Enable the plugin:

Add ensure-kube-context to the plugins list in your ~/.zshrc file:

plugins=(... ensure-kube-context)
  1. Apply changes:

Source your ~/.zshrc file to apply the changes:

source ~/.zshrc

Usage

Once installed and configured, the plugin will automatically ensure that the --context flag is passed to the specified commands.

Contributing

If you’d like to contribute to this project, please fork the repository and create a pull request with your changes.

License

This project is licensed under the MIT License.

About

A ZSH plugin to ensure the --context flag is passed to kubectl.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages