How to connect to Kubernetes from GitLab?
I wanted to connect to my kubernetes (limited availability) cluster from my gitlab repo, firstly I followed this guide and successfully created a user ‘admin-user’ which I could use to sign into Kubernetes Dashboard as an admin
GitLab’s Kubernetes connection page asks for:
- Cluster name -> Which I got from the kubeconfig file beside 'name’
- API URL -> From kubeconfig file beside 'server’
- CA Certificate (PEM) -> From kubeconfig file beside 'certificate-authority-data’ (then base64 decoded)
- Token -> The token created for my admin-user account
- Project namespace -> A new unique one as specified by GitLabs Docs
But I had limited success. GItLab reported 'Something went wrong while installing Helm Tiller’, when I clicked install. There is a final experimental settings in the GitLab UI called 'RBAC-enabled cluster’, I have tried with this setting both checked and unchecked, same results.
After looking at the dashboard, I see a 'gitlab-managed-apps’ namespace had appeared which has done a few things like create a tiller-token secret, a config map and there’s some items listed under events
Is this something I’m doing wrong, a bug with GitLab or a bug with DigitalOcean?
I’m relatively new to Kubernetes so if there’s more I can do to debug the issue please let me know
EDIT: Oh, very strange, I deleted the tiller-secret and config-map left behind, tried clicking install about 3 more times, and now Helm Tiller has deployed successfully, no more errors. So solved for me, although I suspect more people will encounter this issue. (I had RBAC-enabled cluster checked for anyone looking for the same 'fix’)
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.