debian-mirror-gitlab/doc/user/project/clusters/add_gke_clusters.md

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

98 lines
5.3 KiB
Markdown
Raw Normal View History

2020-05-24 23:13:21 +05:30
---
stage: Configure
group: Configure
2022-11-25 23:54:43 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/product/ux/technical-writing/#assignments
2020-05-24 23:13:21 +05:30
---
2023-05-27 22:25:52 +05:30
# Connect GKE clusters through cluster certificates (deprecated) **(FREE)**
2021-12-11 22:18:48 +05:30
> [Deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
2021-09-30 23:02:18 +05:30
WARNING:
2021-12-11 22:18:48 +05:30
This feature was [deprecated](https://gitlab.com/groups/gitlab-org/configure/-/epics/8) in GitLab 14.5.
2022-01-26 12:08:38 +05:30
Use [Infrastructure as Code](../../infrastructure/clusters/connect/new_gke_cluster.md)
2021-11-18 22:05:49 +05:30
to create a cluster hosted on Google Kubernetes Engine (GKE).
2021-09-30 23:02:18 +05:30
2021-11-18 22:05:49 +05:30
Through GitLab, you can create new and connect existing clusters
hosted on Google Kubernetes Engine (GKE).
2020-04-22 19:07:51 +05:30
2021-11-18 22:05:49 +05:30
## Connect an existing GKE cluster
2020-04-22 19:07:51 +05:30
2021-11-18 22:05:49 +05:30
If you already have a GKE cluster and want to connect it to GitLab,
2022-05-07 20:08:51 +05:30
use the [GitLab agent](../../clusters/agent/index.md).
2020-04-22 19:07:51 +05:30
2021-11-18 22:05:49 +05:30
## Create a new GKE cluster from GitLab
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/25925) in GitLab 12.4, all the GKE clusters provisioned by GitLab are [VPC-native](https://cloud.google.com/kubernetes-engine/docs/how-to/alias-ips).
To create a new GKE cluster from GitLab, use [Infrastructure as Code](../../infrastructure/clusters/connect/new_gke_cluster.md).
2020-04-22 19:07:51 +05:30
2021-12-11 22:18:48 +05:30
## Create a new cluster on GKE through cluster certificates
2021-09-30 23:02:18 +05:30
2021-11-18 22:05:49 +05:30
> [Deprecated](https://gitlab.com/groups/gitlab-org/-/epics/6049) in GitLab 14.0.
2020-04-22 19:07:51 +05:30
2021-11-18 22:05:49 +05:30
Prerequisites:
- A [Google Cloud billing account](https://cloud.google.com/billing/docs/how-to/manage-billing-account)
set up with access.
- Kubernetes Engine API and related services enabled. It should work immediately but may
take up to 10 minutes after you create a project. For more information see the
2022-08-27 11:52:29 +05:30
["Before you begin" section of the Kubernetes Engine docs](https://cloud.google.com/kubernetes-engine/docs/deploy-app-cluster#before-you-begin).
2020-04-22 19:07:51 +05:30
Note the following:
- 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. On
GitLab.com, this is enabled.
2021-11-18 22:05:49 +05:30
- In [GitLab 12.1](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/55902) and later, all GKE clusters
2021-09-30 23:02:18 +05:30
created by GitLab are RBAC-enabled. Take a look at the [RBAC section](cluster_access.md#rbac-cluster-resources) for
2020-04-22 19:07:51 +05:30
more information.
2021-11-18 22:05:49 +05:30
- In [GitLab 12.5](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/18341) and later, the
2021-02-22 17:27:13 +05:30
cluster's pod address IP range is set to `/16` instead of the regular `/14`. `/16` is a CIDR
2020-04-22 19:07:51 +05:30
notation.
- GitLab requires basic authentication enabled and a client certificate issued for the cluster to
2022-10-11 01:57:18 +05:30
set up an [initial service account](cluster_access.md). In
2022-08-27 11:52:29 +05:30
[GitLab versions 11.10 and later](https://gitlab.com/gitlab-org/gitlab-foss/-/issues/58208), the cluster creation process
2020-06-23 00:09:42 +05:30
explicitly requests GKE to create clusters with basic authentication enabled and a client
certificate.
2020-04-22 19:07:51 +05:30
2021-11-18 22:05:49 +05:30
To create new Kubernetes clusters to your project, group, or instance, through
cluster certificates:
2020-04-22 19:07:51 +05:30
1. Navigate to your:
2021-09-04 01:27:46 +05:30
- Project's **{cloud-gear}** **Infrastructure > Kubernetes clusters** page, for a project-level
cluster.
2020-04-22 19:07:51 +05:30
- Group's **{cloud-gear}** **Kubernetes** page, for a group-level cluster.
2022-10-11 01:57:18 +05:30
- **Main menu > Admin > Kubernetes** page, for an instance-level cluster.
2022-07-23 23:45:48 +05:30
1. Select **Integrate with a cluster certificate**.
1. Under the **Create new cluster** tab, select **Google GKE**.
2022-11-25 23:54:43 +05:30
1. Connect your Google account if you haven't done already by selecting the
2020-04-22 19:07:51 +05:30
**Sign in with Google** button.
1. Choose your cluster's settings:
- **Kubernetes cluster name** - The name you wish to give the cluster.
2021-09-30 23:02:18 +05:30
- **Environment scope** - The [associated environment](multiple_kubernetes_clusters.md#setting-the-environment-scope) to this cluster.
2020-04-22 19:07:51 +05:30
- **Google Cloud Platform project** - Choose the project you created in your GCP
2023-04-23 21:23:45 +05:30
console to host the Kubernetes cluster. For more information, see
[Creating and managing projects](https://cloud.google.com/resource-manager/docs/creating-managing-projects).
2020-04-22 19:07:51 +05:30
- **Zone** - Choose the [region zone](https://cloud.google.com/compute/docs/regions-zones/)
2021-02-22 17:27:13 +05:30
under which to create the cluster.
2020-04-22 19:07:51 +05:30
- **Number of nodes** - Enter the number of nodes you wish the cluster to have.
- **Machine type** - The [machine type](https://cloud.google.com/compute/docs/machine-types)
2021-02-22 17:27:13 +05:30
of the Virtual Machine instance to base the cluster on.
2020-04-22 19:07:51 +05:30
- **Enable Cloud Run for Anthos** - Check this if you want to use Cloud Run for Anthos for this cluster.
See the [Cloud Run for Anthos section](#cloud-run-for-anthos) for more information.
- **GitLab-managed cluster** - Leave this checked if you want GitLab to manage namespaces and service accounts for this cluster.
2021-09-30 23:02:18 +05:30
See the [Managed clusters section](gitlab_managed_clusters.md) for more information.
2022-07-23 23:45:48 +05:30
1. Finally, select the **Create Kubernetes cluster** button.
2020-04-22 19:07:51 +05:30
2021-09-04 01:27:46 +05:30
After a couple of minutes, your cluster is ready.
2020-04-22 19:07:51 +05:30
### Cloud Run for Anthos
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/16566) in GitLab 12.4.
You can choose to use Cloud Run for Anthos in place of installing Knative and Istio
separately after the cluster has been created. This means that Cloud Run
2021-09-04 01:27:46 +05:30
(Knative), Istio, and HTTP Load Balancing are enabled on the cluster
from the start, and cannot be installed or uninstalled.