How to Fix Billing Warning When Connecting GitLab to New GKE Cluster

3/28/2018

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:

  • I did all steps as described in the official tutorial twice.
  • I verified that GitLab Omniauth is working correctly.
  • I enabled amongst others the following k8s APIs: Cloud Resource Manager API, Cloud Google+ API, Compute Engine API, Kubernetes Engine API
  • The above-mentioned warning provides a link to the GCE billing dashboard. There, I enabled k8s billing (or I assume I did it):
    • I linked my newly created k8s project to a billing account.
    • I upgraded my GCE account according to the web console's notification to enable billing. I assume this means that billing is enabled. I tried both a billing account with free tier promotion and another one without to avoid running into free tier troubles.
  • I waited due to this issue for half a day

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.

-- aboger
gitlab
google-cloud-platform
kubernetes

3 Answers

5/11/2018

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

-- tcd1980
Source: StackOverflow

1/30/2019

After inspecting the network traffic, it seems to be related to certain APIs not being enabled on your project.

  1. Log into your Google Cloud Platform Console.
  2. Make sure you have chosen your project
  3. From the menu, choose API & Services -> Dashboard
  4. Click ENABLE APIS AND SERVICES link at the top of the page.
  5. Search for "Cloud Recource Manager" select it and Enable it.
  6. Go back to API library and search for "Cloud Billing" select and Enable it.

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.

-- John Tipton
Source: StackOverflow

3/28/2018

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:

  1. Go to the Google Cloud Platform Console and sign in or, if you do not already have an account, sign up.
  2. Open the console left side menu and select Billing.
  3. Click the New billing account button.
  4. Enter the name of the billing account and enter your billing information.
  5. Click Submit and enable billing.

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.

-- Anton Kostenko
Source: StackOverflow