<commit_before># Connecting GitLab with a Kubernetes cluster

> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/35954) in GitLab 10.1.

Connect your project to Google Kubernetes Engine (GKE) or an existing Kubernetes
cluster in a few steps.

## Overview

With a Kubernetes cluster associated to your project, you can use
[Review Apps](../../../ci/review_apps/index.md), deploy your applications, run
your pipelines, and much more, in an easy way.

There are two options when adding a new cluster to your project; either associate
your account with Google Kubernetes Engine (GKE) so that you can [create new
clusters](#adding-and-creating-a-new-gke-cluster-via-gitlab) from within GitLab,
or provide the credentials to an [existing Kubernetes cluster](#adding-an-existing-kubernetes-cluster).

## Adding and creating a new GKE cluster via GitLab

NOTE: **Note:**
You need Maintainer [permissions] and above to access the Kubernetes page.

Before proceeding, make sure the following requirements are met:

- The [Google authentication integration](../../../integration/google.md) 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](https://cloud.google.com/billing/docs/how-to/manage-billing-account)
  must be set up and that you have to have permissions to access it.
- You must have Maintainer [permissions] in order to be able to access the
  **Kubernetes** page.
- You must have [Cloud Billing API](https://cloud.google.com/billing/) enabled
- You must have [Resource Manager
  API](https://cloud.google.com/resource-manager/)

If all of the above requirements are met, you can proceed to create and add a
new Kubernetes cluster that will be hosted on GKE to your project:

1. Navigate to your project's **Operations > Kubernetes** page.
1. Click on **Add Kubernetes cluster**.
1. Click on **Create with GKE**.
1. Connect your Google account if you haven't done already by clicking the
   **Sign in with Google** button.
1. Fill in the requested values:
  - **Cluster name** (required) - The name you wish to give the cluster.
  - **GCP project ID** (required) - The ID of the project you created in your GCP
    console that will host the Kubernetes cluster. This must **not** be confused
    with the project name. Learn more about [Google Cloud Platform projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
  - **Zone** - The [zone](https://cloud.google.com/compute/docs/regions-zones/)
    under which the cluster will be created.
  - **Number of nodes** - The number of nodes you wish the cluster to have.
  - **Machine type** - The [machine type](https://cloud.google.com/compute/docs/machine-types)
    of the Virtual Machine instance that the cluster will be based on.
  - **Environment scope** - The [associated environment](#setting-the-environment-scope) to this cluster.
1. Finally, click the **Create Kubernetes cluster** button.<commit_msg>Resolve "Update docs as GKE cluster creation label has changed from "project ID" to "project""<commit_after># Connecting GitLab with a Kubernetes cluster

> [Introduced](https://gitlab.com/gitlab-org/gitlab-ce/issues/35954) in GitLab 10.1.

Connect your project to Google Kubernetes Engine (GKE) or an existing Kubernetes
cluster in a few steps.

## Overview

With a Kubernetes cluster associated to your project, you can use
[Review Apps](../../../ci/review_apps/index.md), deploy your applications, run
your pipelines, and much more, in an easy way.

There are two options when adding a new cluster to your project; either associate
your account with Google Kubernetes Engine (GKE) so that you can [create new
clusters](#adding-and-creating-a-new-gke-cluster-via-gitlab) from within GitLab,
or provide the credentials to an [existing Kubernetes cluster](#adding-an-existing-kubernetes-cluster).

## Adding and creating a new GKE cluster via GitLab

NOTE: **Note:**
You need Maintainer [permissions] and above to access the Kubernetes page.

Before proceeding, make sure the following requirements are met:

- The [Google authentication integration](../../../integration/google.md) 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](https://cloud.google.com/billing/docs/how-to/manage-billing-account)
  must be set up and that you have to have permissions to access it.
- You must have Maintainer [permissions] in order to be able to access the
  **Kubernetes** page.
- You must have [Cloud Billing API](https://cloud.google.com/billing/) enabled
- You must have [Resource Manager
  API](https://cloud.google.com/resource-manager/)

If all of the above requirements are met, you can proceed to create and add a
new Kubernetes cluster that will be hosted on GKE to your project:

1. Navigate to your project's **Operations > Kubernetes** page.
1. Click on **Add Kubernetes cluster**.
1. Click on **Create with Google Kubernetes Engine**.
1. Connect your Google account if you haven't done already by clicking the
   **Sign in with Google** button.
1. Fill in the requested values:
  - **Kubernetes cluster name** - The name you wish to give the cluster.
  - **Environment scope** - The [associated environment](#setting-the-environment-scope) to this cluster.
  - **Google Cloud Platform project** - The project you created in your GCP
    console that will host the Kubernetes cluster. This must **not** be confused
    with the project ID. Learn more about [Google Cloud Platform projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
  - **Zone** - The [zone](https://cloud.google.com/compute/docs/regions-zones/)
    under which the cluster will be created.
  - **Number of nodes** - The number of nodes you wish the cluster to have.
  - **Machine type** - The [machine type](https://cloud.google.com/compute/docs/machine-types)
    of the Virtual Machine instance that the cluster will be based on.
1. Finally, click the **Create Kubernetes cluster** button.
{'fraction_non_alphanumeric': 0.09543436905516804, 'fraction_numerical': 0.004438807863031071, 'mean_word_length': 4.104368932038835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 14, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5544446', 'n_tokens_mistral': 1726, 'n_tokens_neox': 1644, 'n_words': 792}