Adding K8s Cluster to Gitlab for CI/CD

My setup:

  • 1 gitlab VM (ubuntu 16.04, native install)
  • 1 Rancher VM. No FQDN. Access webui with self-signed cert
  • 3x ubuntu 18.04 VMs running rancher kubernetes
  • 1 public IP (80/443 port forwarded to nginx ingress in k8s)

When I try to add a k8s cluster to gitlab using this documentation, it says

There was a problem authenticating with your cluster. Please ensure your CA Certificate and Token are valid.

Even though I can confirm the token is valid (can log into k8s dashboard with it).

How can I properly add the k8s cluster to gitlab?

I am facing the same issue… Do you have any clue?