From 3f2c2e10bc5f39e4b838900386185a36f75b7022 Mon Sep 17 00:00:00 2001 From: Digital Studium Date: Fri, 8 Mar 2024 00:33:59 +0300 Subject: [PATCH] fix(install\_software.sh): add installation of kubectl using curl and make it available system-wide feat(install\_software.sh): improve script by checking if kubectl is already installed before attempting to install it again --- install_software.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/install_software.sh b/install_software.sh index 2a8f0fc..1d6b7e9 100755 --- a/install_software.sh +++ b/install_software.sh @@ -64,3 +64,11 @@ then rm -f pet_0.3.6_linux_amd64.deb fi +# install kubectl +if ! command -v kubectl &> /dev/null +then + curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" + sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl + rm -f kubectl +fi +