Create a new GCP project#

  1. Create new project under the 2i2c GCP org. This lets us do access control more easily, and makes sure 2i2c engineers always have appropriate access to the created project.

  2. Name the project, giving it a unique id. We try to keep the word ‘2i2c’ out of the project name, in case the user decide to exercise their right to replicate at some point.

  3. Keep it inside the 2i2c organization, and locate inside the 2i2c folder.

  4. Use the 2i2c Billing billing account, with id 0157F7-E3EA8C-25AC3C.

  5. Hit the ‘Create’ button

  6. You should see a notification as soon as the project is created. Switch to the freshly created project

  7. GCP requires you to explicitly enable APIs before they can be used. Enable the following APIs:

    1. GKE

    2. Compute Engine

    3. Artifact Registry

    4. Filestore

    Note

    Make sure the correct project is selected while enabling these!

  8. Setup a new cluster inside it via Terraform

Checking quotas and requesting increases#

Finally, we should check what quotas are enforced on the project and increase them as necessary.

  1. Navigate to https://console.cloud.google.com

  2. Select the project you created from the dropdown in the top menu bar

    Tip

    If you can’t find the project you’re looking for, click the “All” tab to see all projects that you have access to.

  3. In the search bar in the top menu, search for “All quotas”

  4. Once on the quotas page, check the checkbox next to the quota you would like to edit, e.g., CPUs, then click “Edit quotas”

  5. In the pane that opens, enter the new limit, e.g. 128 CPUs. You will then be asked to provide some contact information. Click “Submit request” and you will receive a confirmation email.

    Warning

    It is not possible to provide the support@2i2c.org email here, or even cc it. You have to provide then email you are signed in with.

Set up project cost export to bigquery#

Warning

This must be only done if it is a new billing account handled by 2i2c for a specific project, rather than just for a new project under the same billing account. This is a somewhat rare occurrence!

If there is already billing export set up for this billing account as you try to complete these steps, do not change it and raise an issue for engineering to validate what the right thing to do is. Changing existing billing export may cause automated billing code to have issues

Each time we set up a new billing account, we need to set it up to export detailed usage costs to a GCP BigQuery dataset, so we can automatically figure out how much each project costs us. Ideally this would be doable with the GCP billing API, as we do not need detailed metrics - just total cost. However, the GCP billing API is super limited, and does not allow for this. So we need to use bigquery instead.

  1. Go to the Billing Console, and make sure you have selected the correct project in the projects drop down in the top bar.

    Tip

    If you can’t find the project you’re looking for, click the “All” tab to see all projects that you have access to.

  2. Select “Go to Linked Billing account”.

  3. Select “Billing Export” in the left sidebar.

  4. Under “Detailed cost usage”, select “Edit Settings”.

  5. Select the project under which the bigquery dataset should be created. If the same billing account is used for multiple projects, it is alright to centralize them in a single project, if it is ok for users of one project to know the costs of the other.

  6. Select the “dataset” field, and select “Create a new dataset”.

  7. Provide a name (defaulting to cloud_costs) for the name of the datasets.

  8. Select “Region” as the location type, and us-central1 as the region.

  9. Select the “Create dataset” button

  10. Select the created dataset in the “Data set” field now.

  11. Click “Save”.

Bigquery export is now set up!