Skip to content

Instantly share code, notes, and snippets.

@muddydixon
Created January 17, 2018 02:09
Show Gist options
  • Save muddydixon/0baeabff802db2380cc30ffe00fc3760 to your computer and use it in GitHub Desktop.
Save muddydixon/0baeabff802db2380cc30ffe00fc3760 to your computer and use it in GitHub Desktop.
複数の project で kube を利用しているときのツール(要 peco)
#!/bin/bash
function kubectx(){
CTX=$(kubectl config get-contexts | awk 'NR>1 {print $2}' | peco)
if [ x${CTX} != "x" ]; then
kubectl config set current-context $CTX;
fi
}
kubectx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment