Fix kubectl installation (#799)

* Fix kubectl installation

* Fix kubectl installation

* Add --client flag

* Fix for ubuntu 16.04

* Move kubectl apt packages installation to basic.sh

* Combined separated scripts for kubectl installation to one

* Minor fix

* Remove apt-transport-https package from basic.sh

* Delete helm init
This commit is contained in:
Vladimir Safonkin
2020-05-06 08:51:47 +03:00
committed by GitHub
parent ead5b53355
commit 8491d71a0b
6 changed files with 13 additions and 51 deletions

View File

@@ -40,7 +40,7 @@ apt-fast install -y --no-install-recommends \
zip \
zstd
# Electron / VSCode / GitHub Desktop prereqs
# Electron / VSCode / GitHub Desktop / kubectl prereqs
apt-fast install -y --no-install-recommends \
libxkbfile-dev \
pkg-config \
@@ -57,7 +57,8 @@ apt-fast install -y --no-install-recommends \
rpm \
xz-utils \
xorriso \
zsync
zsync \
gnupg2
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
@@ -99,3 +100,4 @@ DocumentInstalledItemIndent "upx"
DocumentInstalledItemIndent "wget"
DocumentInstalledItemIndent "zip"
DocumentInstalledItemIndent "zstd"
DocumentInstalledItemIndent "gnupg2"

View File

@@ -1,40 +0,0 @@
#!/bin/bash
################################################################################
## File: kubernetes-tools.sh
## Desc: Installs kubectl, helm
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/document.sh
source $HELPER_SCRIPTS/apt.sh
## Install kubectl
apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
echo "deb http://apt.kubernetes.io/ kubernetes-$(lsb_release -cs) main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
# Install Helm
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
# Run tests to determine that the software installed as expected
echo "Testing to make sure that script performed as expected, and basic scenarios work"
if ! command -v kubectl; then
echo "kubectl was not installed"
exit 1
fi
if ! command -v helm; then
echo "helm was not installed"
exit 1
fi
echo "Initializing helm"
helm init --client-only
# Document what was added to the image
echo "Lastly, documenting what we added to the metadata file"
DocumentInstalledItem "kubectl ($(kubectl version --short |& head -n 1))"
DocumentInstalledItem "helm ($(helm version --short |& head -n 1))"