Skip to content

Instantly share code, notes, and snippets.

@dennybaa
Last active January 29, 2020 21:31
Show Gist options
  • Save dennybaa/1042010dfcd941f96635f3080561c575 to your computer and use it in GitHub Desktop.
Save dennybaa/1042010dfcd941f96635f3080561c575 to your computer and use it in GitHub Desktop.
Helm enable TLS #helm #k8s #tls
## Enable --tls substitution for helm tls-enabled commands
#
helm() {
_context=$(kubectl config current-context)
if [ -d "${HELM_HOME:-$HOME/.helm}/tls/$_context" ]; then
export HELM_TLS_CA_CERT="${HELM_HOME:-$HOME/.helm}/tls/$_context/ca.cert.pem"
export HELM_TLS_CERT="${HELM_HOME:-$HOME/.helm}/tls/$_context/cert.pem"
export HELM_TLS_KEY="${HELM_HOME:-$HOME/.helm}/tls/$_context/key.pem"
export HELM_TLS_ENABLE="true"
fi
command helm "$@"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment