I'm failing to connect a Kubernetes Cluster with my GitLab CE server. I'm almost a newby when it comes to GCE and k8s. When I try to create a new k8s cluster from GitLab (not to connect an existing cluster), a notification comes up that billing isn't setup correctly yet.
Please enable billing for one of your projects to be able to create a Kubernetes cluster, then try again.
What I did:
Still, I'm running into the same warning. I appreciate any solutions or hints how to proceed to get the connection installed.
In case you want to come up with the solution create and connect an existing server
- I wouldn't mind to do so, but I also tried that. I was able to figure out the API URL of my cluster (kubectl cluster-info
), but it wasn't published to the web, therefore not accessible by GitLab. In case you know how to fix that, please let me know.
The Google authentication integration must be enabled in GitLab at the instance level. If that's not the case, ask your GitLab administrator to enable it. Your associated Google account must have the right privileges to manage clusters on GKE. That would mean that a billing account must be set up and that you have to have permissions to access it. You must have Master permissions in order to be able to access the Kubernetes page. You must have Cloud Billing API enabled You must have Resource Manager API
Seemed to do the trick
After inspecting the network traffic, it seems to be related to certain APIs not being enabled on your project.
Doing this fixed the problem for me. If this doesn't fix your problem, then you can inspect your page and look at the network traffic in your browser. You will see the calls to the Google services and you can read the responses to get more info.
Please enable billing for one of your projects to be able to create a Kubernetes cluster, then try again.
This is a message from Google Cloud. For creating some resources in Google Cloud such a Kubernetes cluster you need first to create a Billing account, link it to your project and enable billing.
Here is an official documentation and you can get detailed instructions there, but in few words, you need:
After that, you can use any tools to create a cluster including a GitLab.
UPDATE
I checked a GitLab documentation and looked like it can also be a permission problem because of:
Your associated Google account must have the right privileges to manage clusters on GKE.
So, I think you can add your GitLab user (looks like you logging in to GitLab using Google account) as the owner of the project which you set in "GCP project ID".
You can do it in few clicks using that instruction about IAM. BTW, it is possible to add as many users to the project as you need with any access rights.
Ensure that both users - GitLab's and you's, have access to the project you want to use to create GKE clusters.