summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/scripts/k8s/install_kubectl.sh
diff options
context:
space:
mode:
Diffstat (limited to 'sdc-os-chef/scripts/k8s/install_kubectl.sh')
-rw-r--r--sdc-os-chef/scripts/k8s/install_kubectl.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/sdc-os-chef/scripts/k8s/install_kubectl.sh b/sdc-os-chef/scripts/k8s/install_kubectl.sh
new file mode 100644
index 0000000000..8d1229b527
--- /dev/null
+++ b/sdc-os-chef/scripts/k8s/install_kubectl.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+kubectl_version=$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
+
+echo "[INFO] kubectl version - ${kubectl_version}"
+
+curl_status=$(curl -w '%{http_code}\n' -LO https://storage.googleapis.com/kubernetes-release/release/${kubectl_version}/bin/linux/amd64/kubectl)
+
+if [ $curl_status != 200 ] ; then
+ echo "[ERROR] Download kubectl failed - $curl_status"
+ exit -1
+fi
+
+chmod +x ./kubectl
+
+sudo mv ./kubectl /usr/local/bin/kubectl
+
+echo "source <(kubectl completion bash)" >> ~/.bashrc
+