Skip to content

Instantly share code, notes, and snippets.

@okere-prince
Forked from cmendible/kubectl_ubuntu_wsl.sh
Created March 13, 2020 16:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okere-prince/430e16b5ea1581a04fd6640a791facbb to your computer and use it in GitHub Desktop.
Save okere-prince/430e16b5ea1581a04fd6640a791facbb to your computer and use it in GitHub Desktop.
Install kubectl on ubuntu (WSL) and use kubectl config from Windows
#!/bin/bash
# Receives your Windows username as only parameter.
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.16.0/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
windowsUser=$1
mkdir -p ~/.kube
ln -sf "/mnt/c/users/$windowsUser/.kube/config" ~/.kube/config
kubectl version
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment