Setting up SSL between Helm and Tiller

11/14/2018

I am following these instructions to setup SSL between helm and tiller When I helm-init like this, I get an error

helm init --tiller-tls --tiller-tls-cert ./tiller.cert.pem --tiller-tls-key ./tiller.key.pem --tiller-tls-verify --tls-ca-cert ca.cert.pem
$HELM_HOME has been configured at /Users/Koustubh/.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!

When I check my pods, I get

tiller-deploy-6444c7d5bb-chfxw                       0/1       ContainerCreating   0          2h

and after describing the pod, I get

Warning  FailedMount  7m (x73 over 2h)  kubelet, gke-myservice-default-pool-0198f291-nrl2  Unable to mount volumes for pod "tiller-deploy-6444c7d5bb-chfxw_kube-system(3ebae1df-e790-11e8-98ae-42010a9800f9)": timeout expired waiting for volumes to attach or mount for pod "kube-system"/"tiller-deploy-6444c7d5bb-chfxw". list of unmounted volumes=[tiller-certs]. list of unattached volumes=[tiller-certs default-token-9x886]
  Warning  FailedMount  1m (x92 over 2h)  kubelet, gke-myservice-default-pool-0198f291-nrl2  MountVolume.SetUp failed for volume "tiller-certs" : secrets "tiller-secret" not found

If I try to delete the running tiller pod like this, it just gets stuck helm reset --debug --force

How can I solve this issue? --upgrade flag with helm init, but that doesn't work either.

-- kosta
kubernetes-helm
ssl

1 Answer

12/20/2018

I had this issue but resolved it by deleting both the tiller deployment and the service and re-initalising.

I'm also using RBAC so have added those commands too:

# Remove existing tiller:
kubectl delete deployment tiller-deploy -n kube-system
kubectl delete service tiller-deploy -n kube-system

# Re-init with your certs 
helm init --tiller-tls --tiller-tls-cert ./tiller.cert.pem --tiller-tls-key ./tiller.key.pem --tiller-tls-verify --tls-ca-cert ca.cert.pem
# Add RBAC service account and role
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
# Re-initialize
helm init --service-account tiller --upgrade
# Test the pod is up
kubectl get pods -n kube-system

NAME                             READY     STATUS    RESTARTS   AGE
tiller-deploy-69775bbbc7-c42wp   1/1       Running   0          5m

# Copy the certs to `~/.helm`
cp tiller.cert.pem ~/.helm/cert.pem
cp tiller.key.pem ~/.helm/key.pem

Validate that helm is only responding via tls

$ helm version
Client: &version.Version{SemVer:"v2.10.0", GitCommit:"9ad53aac42165a5fadc6c87be0dea6b115f93090", GitTreeState:"clean"}
Error: cannot connect to Tiller
$ helm version --tls
Client: &version.Version{SemVer:"v2.10.0", GitCommit:"9ad53aac42165a5fadc6c87be0dea6b115f93090", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.10.0", GitCommit:"9ad53aac42165a5fadc6c87be0dea6b115f93090", GitTreeState:"clean"}

Thanks to https://github.com/helm/helm/issues/4691#issuecomment-430617255 https://medium.com/@pczarkowski/easily-install-uninstall-helm-on-rbac-kubernetes-8c3c0e22d0d7

-- Spangen
Source: StackOverflow