Delete auto deployed charts by using gitlabs tiller instance?

2/19/2019

I am using the Gitlab Auto DevOps CI pipeline and I want to remove a deployment using helm.

I try to connect to tiller like this helm init --client-only --tiller-namespace=gitlab-managed-apps which results in

$HELM_HOME has been configured at /Users/marvin/.helm. Not installing Tiller due to 'client-only' flag having been set Happy Helming!

helm list --namespace=gitlab-managed-appsreturns Error: could not find tiller

-- mrvnklm
gitlab-ci
kubernetes
kubernetes-helm

2 Answers

5/15/2019

I had the same problem. I've found the solution to list releases here : https://forum.gitlab.com/t/orphaned-apps-in-gitlab-managed-apps-namespace/22717/9

export TILLER_NAMESPACE="gitlab-managed-apps"

kubectl get secrets/tiller-secret -n "$TILLER_NAMESPACE" -o "jsonpath={.data['ca\.crt']}" | base64 --decode > tiller-ca.crt
kubectl get secrets/tiller-secret -n "$TILLER_NAMESPACE" -o "jsonpath={.data['tls\.crt']}" | base64 --decode > tiller.crt
kubectl get secrets/tiller-secret -n "$TILLER_NAMESPACE" -o "jsonpath={.data['tls\.key']}" | base64 --decode > tiller.key

helm list --tiller-connection-timeout 30 --tls --tls-ca-cert tiller-ca.crt --tls-cert tiller.crt --tls-key tiller.key --all --tiller-namespace gitlab-managed-apps

You can then run :

helm delete <name> [--purge] --tiller-connection-timeout 30 --tls --tls-ca-cert tiller-ca.crt --tls-cert tiller.crt --tls-key tiller.key --tiller-namespace gitlab-managed-apps

Edit:

@mrvnklm proposed to use -D options for base64. In my case, it doesn't work anymore with "d" uppercased. After checks, I guess it's for macOs users(man page base64 osx). For linux, it seems to be "-d" (man page linux). Changed to "--decode" according to mrvnklm's comment.

-- chok
Source: StackOverflow

2/19/2019

As you did a "client-only" helm --init, helm doesn't know how to find the correct tiller instance.

You need to specify where the tiller is in your subsequent calls to helm list.

This is touched upon in the helm install documentation here. You will either need to set HELM_HOST environment variable, or add --host to every call. You will also need to specify (and have access to) any TLS certificates used to make the Gitlab Auto DevOps connection.

-- Paul Annetts
Source: StackOverflow