Skip to content

Instantly share code, notes, and snippets.

@febri4n
Last active April 22, 2024 02:30
Show Gist options
  • Save febri4n/980a20fc592be69f85b08ea96b624a1f to your computer and use it in GitHub Desktop.
Save febri4n/980a20fc592be69f85b08ea96b624a1f to your computer and use it in GitHub Desktop.
install kubectl
#!/bin/bash
# Step 1
curl -LO https://dl.k8s.io/release/`curl -LS https://dl.k8s.io/release/stable.txt`/bin/linux/amd64/kubectl
# Step 2
chmod +x ./kubectl
# Step 3
sudo mv ./kubectl /usr/local/bin/kubectl
# Step 4
mkdir .kube
# Step 5
touch .kube/config
# Step 6
sudo apt-get install bash-completion -y && source <(kubectl completion bash) && echo "source <(kubectl completion bash)" >> $HOME/.bashrc
# export KUBECONFIG=~/.kube/config
# chmod 600 ~/.kube/config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment