Skip to content

Instantly share code, notes, and snippets.

@terrymafura
Forked from cmendible/kubectl_ubuntu_wsl.sh
Created January 9, 2020 12:54
Show Gist options
  • Save terrymafura/11431b82cb64a0b7b5b04dcd32e381a6 to your computer and use it in GitHub Desktop.
Save terrymafura/11431b82cb64a0b7b5b04dcd32e381a6 to your computer and use it in GitHub Desktop.

Revisions

  1. @cmendible cmendible created this gist Nov 16, 2019.
    14 changes: 14 additions & 0 deletions kubectl_ubuntu_wsl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/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