-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelm.sh
executable file
·52 lines (45 loc) · 1.01 KB
/
helm.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
set -e
function install() {
if [ ! -f /tmp/linux-amd64 ] ; then
echo "Install helm binary"
wget -q https://storage.googleapis.com/kubernetes-helm/helm-v${HELM_VERSION}-linux-amd64.tar.gz -O /tmp/helm.tgz
tar xzfv /tmp/helm.tgz -C /tmp
fi
}
function clean() {
echo "Cleaning old helm config"
rm -Rf ~/.helm
}
function wait_ready() {
while [ "$(kubectl -n kube-system get pod -l app=helm | grep -c Running)" != "1" ] ; do
sleep 2
done
echo "Helm ready"
sleep 30
}
function init_local() {
echo "Deploying helm locally only"
helm init --client-only
}
function init() {
echo "Deploy helm on K8S cluster"
kubectl apply -f tests/k8s-euft/tiller.yaml
helm init --service-account tiller --wait
wait_ready
}
case "$1" in
local_install)
clean
install
init_local
;;
install)
clean
install
init
;;
*)
echo "Usage: $0 <local_install|install>"
exit 1
esac