Skip to content

Instantly share code, notes, and snippets.

@aldinkapetanovic
Last active June 9, 2024 16:37
Show Gist options
  • Save aldinkapetanovic/c562ea73faef66266b860b4bf8e0a738 to your computer and use it in GitHub Desktop.
Save aldinkapetanovic/c562ea73faef66266b860b4bf8e0a738 to your computer and use it in GitHub Desktop.
RKE2 - kubectl PATH, completion & alias
sudo su
echo 'export PATH=$PATH:/var/lib/rancher/rke2/bin' >> ~/.bashrc
echo 'export KUBECONFIG=/etc/rancher/rke2/rke2.yaml' >> ~/.bashrc
kubectl completion bash | sudo tee /etc/bash_completion.d/kubectl > /dev/null
sudo chmod a+r /etc/bash_completion.d/kubectl
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -o default -F __start_kubectl k' >> ~/.bashrc
exit
echo 'export PATH=$PATH:/var/lib/rancher/rke2/bin' >> ~/.bashrc
echo 'export KUBECONFIG=/etc/rancher/rke2/rke2.yaml' >> ~/.bashrc
echo 'source <(kubectl completion bash)' >>~/.bashrc
echo 'alias k=kubectl' >> ~/.bashrc
echo 'complete -o default -F __start_kubectl k' >> ~/.bashrc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment