This is a repo that Patrick uses to add documentation and other things to make life easier and automate setup various systems
- Install xcode.
sudo xcode-select --install
- Install Rosetta2
sudo /usr/sbin/softwareupdate --install-rosetta --agree-to-license
- Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew update
- Install various packages you need for DevOps work
brew install github terraform helm kubectl fzf
- Set homebrew path
echo 'export PATH=$PATH:/opt/homebrew/bin >> ~/.zshrc'
and. ~/.zshrc
- Install kubectl krew plugin manager
(
set -x; cd "$(mktemp -d)" &&
OS="$(uname | tr '[:upper:]' '[:lower:]')" &&
ARCH="$(uname -m | sed -e 's/x86_64/amd64/' -e 's/\(arm\)\(64\)\?.*/\1\2/' -e 's/aarch64$/arm64/')" &&
KREW="krew-${OS}_${ARCH}" &&
curl -fsSLO "https://github.com/kubernetes-sigs/krew/releases/latest/download/${KREW}.tar.gz" &&
tar zxvf "${KREW}.tar.gz" &&
./"${KREW}" install krew
)
- Add krew path to Zsh rc file
echo 'export PATH="${KREW_ROOT:-$HOME/.krew}/bin:$PATH"' >> ~/.zshrc
and. ~/.zshrc
- Install kubectl ns plugin Run
kubectl krew install ns
- Set up kubectl command completion
mkdir -p ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/
kubectl completion zsh > ~/.oh-my-zsh/custom/plugins/kubectl-autocomplete/kubectl-autocomplete.plugin.zsh
- Setup kubectl ns command completion
curl -LO https://raw.githubusercontent.com/ahmetb/kubectx/master/kubectx
curl -LO https://raw.githubusercontent.com/ahmetb/kubectx/master/kubens
sudo chmod +x ./{kubectx,kubens}
sudo mv ./{kubectx,kubens} /usr/local/bin/
mkdir -p ~/.oh-my-zsh/completions
curl -L https://raw.githubusercontent.com/ahmetb/kubectx/master/completion/kubectx.zsh -o ~/.oh-my-zsh/completions/_kubectx.zsh
curl -L https://raw.githubusercontent.com/ahmetb/kubectx/master/completion/kubens.zsh -o ~/.oh-my-zsh/completions/_kubens.zsh
Please also see Michael's setup