쿠버네티스 컨트롤러(kubectl)와 클러스터 컨트롤러(clusterctl)의 자동완성 기능을
사용하기 위해 Kubectl와 Clusterctl 먼저 설치합니다.
export ARCH=amd64
mkdir -pv ~/_setup && cd ~/_setup
cat <<EOT > kube_install.sh
# kubectl
sudo apt update -y
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl"
curl -LO "https://dl.k8s.io/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
rm kubectl
# clusterctl
curl -L https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.5.2/clusterctl-linux-${ARCH} -o clusterctl
sudo install -o root -g root -m 0755 clusterctl /usr/local/bin/clusterctl
rm clusterctl
kubectl version --client --output=yaml
# setting PATH & completions
echo 'kubectl completion zsh > \$HOME/Repos/zsh-users/zsh-completions/src/_kubectl' >> $HOME/.zshrc
echo 'clusterctl completion zsh > \$HOME/Repos/zsh-users/zsh-completions/src/_clusterctl' >> $HOME/.zshrc
EOT
chmod +x kube_install.sh && ./kube_install.sh
source ~/.zshrc