we have GitLab running on our local server and also a kubernetes cluster. I want to use the kubernetes integration to deploy the runner on our cluster.
So I followed the instructions on the documentation site and everything went like described:
After i saved alle options (including ip, cert and token) i get the following error:
There was a problem authenticating with your cluster. Please ensure your CA Certificate and Token are valid.
I verified token and cert with an curl call with exact the same data and i got a valid result from the kubernetes cluster. Furthermore i made the curl call also from our gitlab server machine so that there is no firewall-problem. This worked aswell.
I tailed and grepped the latest logs but the ip adress was not found.
Do you have any ideas, what the problem might be? Are there log files where to look after the connection attempt?
In my case, I use LetsEncrypt for the Kubernetes server. It works fine when I test with CURL, but Gitlab doesn’t like it. I downloaded the root certificates and reconfigured gitlab, like so:
the solution in my case was very simple. I entered the kubernetes adress including the path to the api. I missread the documentation at one point. After I corrected the value and set it only to the kubernetes adress, it worked.
Here is my solution.
I generate the token according the documentation.
But when I copy the token, my shell soft-wrap the token and ADD new line charater add the end of each line, which cause the error!
How to get Gitlab to print to kubernetes.log? It does not appear to be enabled by default and we’re on the latest 13.5.2 release and no logs are being outputting. I even manually created the file and gave it the same permissions as the other log files in the /var/log/gitlab/gitlab-rails/ directory with no success.
Even after verifying the token and cert are correct (without newlines) we still get the same issue. Kubernetes endpoint is signed by a custom CA so perhaps that could be the issue.
I’ve just solved issue for me and found a mistake There was a problem authenticating with your cluster. Please ensure your CA Certificate and Token are valid.