Areli Fuss | 471a2970 | 2018-02-01 13:09:07 +0200 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | kubectl_version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt) |
| 4 | |
| 5 | echo "[INFO] kubectl version - ${kubectl_version}" |
| 6 | |
| 7 | curl_status=$(curl -w '%{http_code}\n' -LO https://storage.googleapis.com/kubernetes-release/release/${kubectl_version}/bin/linux/amd64/kubectl) |
| 8 | |
| 9 | if [ $curl_status != 200 ] ; then |
| 10 | echo "[ERROR] Download kubectl failed - $curl_status" |
| 11 | exit -1 |
| 12 | fi |
| 13 | |
| 14 | chmod +x ./kubectl |
| 15 | |
| 16 | sudo mv ./kubectl /usr/local/bin/kubectl |
| 17 | |
| 18 | echo "source <(kubectl completion bash)" >> ~/.bashrc |
| 19 | |