Home

Awesome

Kustomize Oh My ZSH Plugin

This Oh My ZSH plugin adds completion for Kustomize, the Kubernetes native configuration management tool, as well as some useful aliases for common commands.

To use this plugin:

  1. Install the plugin:
git clone https://github.com/ralgozino/oh-my-kustomize ~/.oh-my-zsh/plugins/kustomize

or in your custom plugins folder:

git clone https://github.com/ralgozino/oh-my-kustomize ~/.oh-my-zsh/custom/plugins/kustomize
  1. Add kustomize to the plugins array in your .zshrc file:
plugins=(... kustomize)
  1. Open a new shell or source your .zshrc file.

💡 Notice that Kustomize changed the command to generate the command completinos in v3.8.6.

For versions 3.8.5 or earlier you'll need to activate the command completion manualy by running:

kustomize install-completions

Aliases

AliasCommandDescription
kzkustomizeRuns kustomize, you can pass the subcomands you want, i.e. kz build
kzbkustomize buildRuns kustoimze build, you can pass more flags and argunments to the command, like the folder.
kzbykustomize build <args> | yhWill run kustomize build and pipe the output to yh for YAML formatting.
kzbakustomize build <args> | kubectl apply -f -Will run kustomize build and pipe the output to kubectl apply.
kzbaskustomize build <args> | kubectl apply -f - --server-sideWill run kustomize build and pipe the output to kubectl apply --server-side.
kzbasfkustomize build <args> | kubectl apply -f - --server-side --force-conflictsWill run kustomize build and pipe the output to kubectl apply --server-side --froce-conflicts.
kzbdelkustomize build <args> | kubectl delete -f - Will run kustomize build and pipe the output to kubectl delete.
kzckustomize createRuns kustomize create
kzcakustomize createRuns kustomize create --autodetect
kzcarkustomize createRuns kustomize create --autodetect --recursive
kzekustomize editRuns kustomize edit
kzvkustomize versionRuns kustomize version

Honorable mention

This plugin is heavily based on the official oh-my-zsh kubectl plugin.