Files
runner-images/images/linux/scripts/installers/kubernetes-tools.sh
T

53 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/bash
################################################################################
## File: kubernetes-tools.sh
2020-08-17 14:06:21 +05:30
## Desc: Installs kubectl, helm, kustomize
################################################################################
## Install kubectl
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
touch /etc/apt/sources.list.d/kubernetes.list
2020-05-06 08:51:47 +03:00
# Based on https://kubernetes.io/docs/tasks/tools/install-kubectl/, package is xenial for both OS versions.
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list
apt-get update
apt-get install -y kubectl
# Install Helm
2019-12-18 11:44:32 -08:00
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
# Install minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
2020-08-17 14:06:21 +05:30
# Install kustomize
2020-08-31 14:39:57 +02:00
download_url="https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
curl -s "$download_url" | bash
2020-08-28 18:14:03 +02:00
mv kustomize /usr/local/bin
# 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
# Run tests to determine that the software installed as expected
echo "Testing to make sure that minikube was installed"
if ! command -v minikube; then
echo "minikube was not installed"
exit 1
fi
2020-08-17 14:06:21 +05:30
echo "Testing to make sure that kustomize was installed"
if ! command -v kustomize; then
echo "kustomize was not installed"
exit 1
fi