Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gitlab-installed Helm: Error: context deadline exceeded

Tags:

gitlab

I've a Kubernetes cluster installed in AWS with Kops. I've installed Helm Tiller with the Gitlab UI. The Tiller service seems to be working via Gitlab, for example I've installed Ingress from the Gitlab UI.

But when trying to use that same Tiller from my CLI, I can't manage to get it working. When I helm init it says it's already installed (which makes totally sense):

helm init --tiller-namespace gitlab-managed-apps --service-account tiller
$HELM_HOME has been configured at C:\Users\danie\.helm.
Warning: Tiller is already installed in the cluster.
(Use --client-only to suppress this message, or --upgrade to upgrade Tiller to the current version.)
Happy Helming!

But when trying to, for example, list the charts, it takes 5 minutes and then timeouts:

$ helm list --tiller-namespace gitlab-managed-apps --debug
[debug] Created tunnel using local port: '60471'

[debug] SERVER: "127.0.0.1:60471"

Error: context deadline exceeded

What I'm missing so I can use the Gitlab-installed Tiller from my CLI?

like image 926
Daniel Ramos Avatar asked Apr 09 '19 08:04

Daniel Ramos


2 Answers

Are you pretty sure that your Tiller server is installed in "gitlab-managed-apps" namespace ? By default it's installed to 'kube-system' one as per official installation instruction on GitLab website, which would mean this is what causes your helm ls command to fail (just skip it)

The best way to verify it is via:

kubectl get deploy/tiller-deploy -n gitlab-managed-apps

Do you see any tiller related deployment object in that namespace ?

Assuming your can operate your KOPS cluster with current kube context, you should have no problem with running helm client locally. You can always explicitly use --kube-context argument with helm command.

Update:

I think I know what causes your problem, Helm when installed via GitLab UI is using secured connection (SSL) between helm and tiller (proof here).

Knowing that, it means you should retrieve set of certificates from Secret object that is mounted on Tiller Pod:

#The CA
ca.cert.pem
ca.key.pem
#The Helm client files
helm.cert.pem
helm.key.pem
#The Tiller server files
tiller.cert.pem
tiller.key.pem

and then connect helm client to tiller server using following command, as explained here:

helm ls --tls --tls-ca-cert ca.cert.pem --tls-cert helm.cert.pem --tls-key helm.key.pem
like image 55
Nepomucen Avatar answered Oct 09 '22 20:10

Nepomucen


Here's the way I've been doing this.

First open a shell in the gitlab tiller pod:

# replace the pod name, tiller-deploy-5bb888969c-7bzpl with your own
kubectl exec -n gitlab-managed-apps tiller-deploy-5bb888969c-7bzpl -it -- sh

Then use the pod's native helm and certs... to connect to tiller

$ env | grep TILLER_TLS_CERTS
#cd to the result, in my case /etc/certs
$ cd /etc/certs
# connect to tiller with the certs using the native helm (/helm) in my case:
$ /helm ls --tls --tls-ca-cert ./ca.crt --tls-cert ./tls.crt --tls-key ./tls.key
like image 28
mikeLundquist Avatar answered Oct 09 '22 20:10

mikeLundquist