/kubectl-extract

Kubectl plugin to extract a kubernetes context including authinfo, cluster and namespace.

Primary LanguageGoApache License 2.0Apache-2.0

kubectl-extract

Don't use this

I threw this go cli together quickly and then found out that kubectl actually has this functionality built in, albeit somewhat hidden. The command is:

kubectl config view --minify=true --flatten --context foocontext

These are the aliases I use now:

alias kubectl-extract-context='kubectl config view --minify=true --flatten --context'
alias kec='kubectl-extract-context'

Works really well with tab completion in zsh. If you type kec and TAB you will see a list of contexts.