Question:Hi I’m trying to authenticate a Kubernetes Cluster with Gitlab. Im doing it via the Certificate method and followed the guide on gitlabs documentation
But it doesn’t connect. Gitlab tells me:
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?
There was a problem authenticating with your cluster. Please ensure your CA Certificate and Token are valid.
One thing I noticed is that
kubectl cluster-infoshows the url to be a private IP:
https://10.254.1.3:6443. 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?
I tried changing the server IP in
.kube/configto the public IP but then
kubectl cluster-infodid not terminate anymore.
Answer:The problem was that the Cluster was not accessible from outside. I found a solution on this question. I had to generate new certificates that also certify the public IP.
First I had to remove the certificates:
and then generate new ones with the public IP:
sudo rm /etc/kubernetes/pki/apiserver.*
sudo kubeadm init phase certs apiserver --apiserver-cert-extra-sans=<public_ip>
If you have better answer, please add a comment about this, thank you!