Skip to content

Instantly share code, notes, and snippets.

@aaronkjones
Last active November 21, 2022 18:31
Show Gist options
  • Select an option

  • Save aaronkjones/ca4fed7cc1c8cee74efd6e7879c14a34 to your computer and use it in GitHub Desktop.

Select an option

Save aaronkjones/ca4fed7cc1c8cee74efd6e7879c14a34 to your computer and use it in GitHub Desktop.

Revisions

  1. aaronkjones revised this gist Nov 21, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -2,6 +2,6 @@

    ```shell
    $ mkdir -P ~/.local/bin
    $ wget https://gist.github.com/aaronkjones/ca4fed7cc1c8cee74efd6e7879c14a34/raw/f5180810538593f54f0af4358e7b04566d48925f/install-kubectl.sh ~/.local/bin/install-kubectl.sh`
    $ wget https://gist.github.com/aaronkjones/ca4fed7cc1c8cee74efd6e7879c14a34/raw/f5180810538593f54f0af4358e7b04566d48925f/install-kubectl.sh -O ~/.local/bin/install-kubectl.sh`
    $ ~/.local/bin/install-kubectl.sh v1.21.14
    ```
  2. aaronkjones revised this gist Nov 21, 2022. 1 changed file with 7 additions and 1 deletion.
    8 changes: 7 additions & 1 deletion README.md
    Original file line number Diff line number Diff line change
    @@ -1 +1,7 @@
    # README
    # README

    ```shell
    $ mkdir -P ~/.local/bin
    $ wget https://gist.github.com/aaronkjones/ca4fed7cc1c8cee74efd6e7879c14a34/raw/f5180810538593f54f0af4358e7b04566d48925f/install-kubectl.sh ~/.local/bin/install-kubectl.sh`
    $ ~/.local/bin/install-kubectl.sh v1.21.14
    ```
  3. aaronkjones revised this gist Nov 21, 2022. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    # README
  4. aaronkjones created this gist Nov 15, 2022.
    15 changes: 15 additions & 0 deletions install-kubectl.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    #!/bin/bash

    set -ex

    if [ -z "$1" ]; then
    CLI_VERSION="v1.21.14"
    else
    CLI_VERSION="$1"
    fi

    curl -LO "https://dl.k8s.io/release/$CLI_VERSION/bin/linux/amd64/kubectl"
    curl -LO "https://dl.k8s.io/release/$CLI_VERSION/bin/linux/amd64/kubectl.sha256"
    echo "$(cat kubectl.sha256) kubectl" | sha256sum --check && \
    sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl && \
    kubectl version