3 if [ -f "$HOME/.bashrc" ]; then
4 # shellcheck source=/dev/null
9 TILLER_SA_RBAC=~/tiller-rbac.yaml
10 if [ "$(uname -m)" == 'aarch64' ]; then
16 URI_ROOT='https://storage.googleapis.com/kubernetes-helm'
17 TGZ_NAME="helm-${VERSION}-${FLAVOR}.tar.gz"
19 if [ ! -e /usr/bin/helm ] || [ ! -e /usr/bin/tiller ]; then
20 wget -O "/tmp/${TGZ_NAME}" "${URI_ROOT}/${TGZ_NAME}"
21 sudo tar xpPf "/tmp/${TGZ_NAME}" --overwrite \
22 --transform "s|${FLAVOR}|/usr/bin|" "${FLAVOR}/"{helm,tiller}
23 rm -f "/tmp/${TGZ_NAME}"
26 if ! kubectl get serviceaccounts --namespace=kube-system | grep -q tiller; then
27 cat <<EOF > "${TILLER_SA_RBAC}"
32 namespace: kube-system
34 apiVersion: rbac.authorization.k8s.io/v1
35 kind: ClusterRoleBinding
39 apiGroup: rbac.authorization.k8s.io
43 - kind: ServiceAccount
45 namespace: kube-system
47 kubectl create -f "${TILLER_SA_RBAC}"
48 helm init --service-account tiller --tiller-image="jessestuart/tiller:${VERSION}"
50 rm -f "${TILLER_SA_RBAC}"