Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save PrettySolution/52657dad71e1ee6d9d030050f7505009 to your computer and use it in GitHub Desktop.
Save PrettySolution/52657dad71e1ee6d9d030050f7505009 to your computer and use it in GitHub Desktop.
This script installs kubectl kubectx and helm to you ubuntu. I usually use docker to connect kubectl. But I created this for some reason. Enjoy
# update
sudo apt-get update
sudo apt-get -qq update
# Install kubectl
sudo curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
sudo chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
# Install kubectx (Switch between Kubernetes contexts/namespaces)
sudo curl -sSL https://github.com/ahmetb/kubectx/releases/download/v0.9.1/kubectx_v0.9.1_linux_x86_64.tar.gz | tar -C /usr/local/bin/ -xz
export PATH=/usr/local/bin/kubectx:$PATH
# Install kubens (Switch between Kubernetes contexts/namespaces)
sudo curl -sSL https://github.com/ahmetb/kubectx/releases/download/v0.9.1/kubens_v0.9.1_linux_x86_64.tar.gz | tar -C /usr/local/bin/ -xz
# Install Helm (The Kubernetes Package Manager)
curl -Lo /tmp/helm-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.1.3-linux-amd64.tar.gz
tar -xvf /tmp/helm-linux-amd64.tar.gz -C /tmp/
chmod +x /tmp/linux-amd64/helm && sudo mv /tmp/linux-amd64/helm /usr/local/bin/
# Add your kubeconfig
# sudo vim /home/ubuntu/.kube/config
# Configure dns if necessary
# sudo vim /etc/resolv.conf
# add top of the file
# nameserver <your dns server ip>
# Initialize helm
helm init
helm repo update
helm ls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment