Skip to content

Instantly share code, notes, and snippets.

@afirth afirth/
Created Jan 26, 2019

What would you like to do?
tillerless helm
#!/usr/bin/env bash
# this starts a local tiller service with secret storage driver, then runs helm commands against it
# setting $TILLER_NAMESPACE is strongly recommended
# usage: ./ <valid helm args>
# afirth 2018
set -eu -o pipefail
# default to use if TILLER_NAMESPACE is not set
# kube-system (the default) is not a great idea
# but you can export TILLER_NAMESPACE=kube-system if you like
#the default
# create tiller-namespace if it doesn't exist (helm --init would usually do this with server-side tiller'
set +u
if [ -z "$TILLER_NAMESPACE" ]; then
echo "\$TILLER_NAMESPACE is empty. USING $default_namespace."
export TILLER_NAMESPACE=$default_namespace
kubectl get namespace $TILLER_NAMESPACE || \
(echo "Creating tiller namespace $TILLER_NAMESPACE" && \
kubectl create namespace $TILLER_NAMESPACE)
set -u
tiller --storage=secret --listen localhost:44134 &
#wait for tiller to start
while ! echo exit | nc localhost $tport; do sleep 1; done
export HELM_HOST=localhost:$tport
helm "$@"
pkill tiller
exit $ec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.