<p>Hi I'm trying to authenticate a Kubernetes Cluster with Gitlab.
Im doing it via the Certificate method and followed the guide on <a href="https://docs.gitlab.com/ee/user/project/clusters/add_existing_cluster.html" rel="nofollow noreferrer">gitlabs documentation</a></p>
<p>But it doesn't connect. Gitlab tells me:</p>
<pre><code>There was a problem authenticating with your cluster. Please ensure your CA Certificate and Token are valid. 
</code></pre>
<p>There was a firewall issue my boss thought would be the reason.
But now that the Firewall issue has been resolved and the problem persists I don't know what could be the cause. Is there some log file that could help me pin down the reason?</p>
<p>One thing I noticed is that <code>kubectl cluster-info</code> shows the url to be a private IP:
<code>https://10.254.1.3:6443</code>.
I don't know for sure, but I thought I've dealt with a few programs that only respond to requests within the network when the url is local. Could this be an issue?</p>
<p>I tried changing the server IP in <code>.kube/config</code> to the public IP but then <code>kubectl cluster-info</code> did not terminate anymore.</p>

iaquobe
<p>The problem was that the Cluster was not accessible from outside. I found a solution on this <a href="https://stackoverflow.com/questions/61871640/access-kubernetes-api-remotely?rq=1">question</a>. I had to generate new certificates that also certify the public IP.</p>
<p>First I had to remove the certificates:</p>
<pre><code>sudo rm /etc/kubernetes/pki/apiserver.*
</code></pre>
<p>and then generate new ones with the public IP:</p>
<pre><code>sudo kubeadm init phase certs apiserver --apiserver-cert-extra-sans=&lt;public_ip&gt;
</code></pre>
