Skip to content

Instantly share code, notes, and snippets.

@jonmoter
Created January 20, 2020 03:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonmoter/0d384bd9044d950d0351aaba10227588 to your computer and use it in GitHub Desktop.
Save jonmoter/0d384bd9044d950d0351aaba10227588 to your computer and use it in GitHub Desktop.
script to install krew and some plugins
#!/usr/bin/env bash
# https://github.com/kubernetes-sigs/krew/
set -ex
krew_version=v0.2.1
if [ -d $HOME/.krew ] ; then
echo "krew already installed"
else
cd "$(mktemp -d)"
curl -fsSLO "https://storage.googleapis.com/krew/${krew_version}/krew.{tar.gz,yaml}"
tar zxvf krew.tar.gz
krew_binary="./krew_$(uname | tr '[:upper:]' '[:lower:]')_amd64"
${krew_binary} install --manifest=krew.yaml --archive=krew.tar.gz
fi
plugin_list="
access-matrix
sniff
tree
who-can
"
for plugin in $plugin_list ; do
kubectl krew install "$plugin"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment