helm-wrapper is a tool that wraps Kubernetes Helm to simplify helm/tiller version management.
When using helm
, have you ever seen this message, or something similar?
Error: incompatible versions client[v2.9.1] server[v2.8.2]
Given that:
- Helm has two parts: a client (
helm
) and a server (tiller
) - In many cases the client and the server versions must match for a
helm
call to succeed. - A common Helm security best practice is installing a
tiller
server in each Kubernetes namespace thathelm
will be used. - Many organizations use multiple clusters.
Keeping the same tiller
version across all clusters and all namespaces at all times is impractical. This forces users and build scripts to use several different helm
client versions - a problem that is frustrating and error-prone.
helm-wapper solve this problem by negotiating with the target tiller
, determining its version, and then using the corresponding helm
client for each request. It does this automatically so the user/script does not need to be modified from its current helm
usage.
For helm
commands that call the server, helm-wrapper must first calculate the tiller
namespace so that it can determine the installed tiller
version. It uses the following algorithm to determine the tiller
namespace:
- use
--tiller-namespace
if specified in command - use TILLER_NAMESPACE environment variable if it is set
- use the current
kubectl config
("kubeconfig") namespace if it is set ← this is divergent behavior fromhelm
, but simplifies working in a tiller-per-namespace environment - use the default
helm
namespace,kube-system
HELM_WRAPPER_VERSION=v1.0.0
# remove old helm if it exists
sudo rm -rf /usr/local/bin/helm
# install helm wrapper
curl https://raw.githubusercontent.com/cradlepoint/helm-wrapper/${HELM_WRAPPER_VERSION}/helm -o helm
chmod +x ./helm
sudo mv ./helm /usr/local/bin/helm
# download helm installer
curl https://raw.githubusercontent.com/cradlepoint/helm-wrapper/${HELM_WRAPPER_VERSION}/install-helm-versions.sh -o install-helm-versions.sh
chmod +x ./install-helm-versions.sh
# use installer to install desired helm versions (https://github.com/helm/helm/releases)
# usage: ./install-helm-versions.sh [ver1 ver2 verN]
./install-helm-versions.sh 2.12.3 2.13.1