- GKE requirements
- New GKE cluster
- Existing GKE cluster
GitLab supports adding new and existing GKE clusters.
Before creating your first cluster on Google GKE with GitLab’s integration, make sure the following requirements are met:
- A billing account set up with access.
- The Kubernetes Engine API and related service are enabled. It should work immediately but may take up to 10 minutes after you create a project. For more information see the “Before you begin” section of the Kubernetes Engine docs.
- 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. On GitLab.com, this is enabled.
- Starting from GitLab 12.1, all GKE clusters created by GitLab are RBAC-enabled. Take a look at the RBAC section for more information.
- Starting from GitLab 12.5, the cluster’s pod address IP range will be set to /16 instead of the regular /14. /16 is a CIDR notation.
- GitLab requires basic authentication enabled and a client certificate issued for the cluster to set up an initial service account. In GitLab versions 11.10 and later, the cluster creation process explicitly requests GKE to create clusters with basic authentication enabled and a client certificate.
To create and add a new Kubernetes cluster to your project, group, or instance:
- Navigate to your:
- Project’s Operations > Kubernetes page, for a project-level cluster.
- Group’s Kubernetes page, for a group-level cluster.
- Admin Area > Kubernetes page, for an instance-level cluster.
- Click Add Kubernetes cluster.
- Under the Create new cluster tab, click Google GKE.
- Connect your Google account if you haven’t done already by clicking the Sign in with Google button.
- Choose your cluster’s settings:
- Kubernetes cluster name - The name you wish to give the cluster.
- Environment scope - The associated environment to this cluster.
- Google Cloud Platform project - Choose the project you created in your GCP console that will host the Kubernetes cluster. Learn more about Google Cloud Platform projects.
- Zone - Choose the region zone under which the cluster will be created.
- Number of nodes - Enter the number of nodes you wish the cluster to have.
- Machine type - The machine type of the Virtual Machine instance that the cluster will be based on.
- 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 for more information.
- GitLab-managed cluster - Leave this checked if you want GitLab to manage namespaces and service accounts for this cluster. See the Managed clusters section for more information.
- Finally, click the Create Kubernetes cluster button.
After a couple of minutes, your cluster will be ready to go. You can now proceed to install some pre-defined applications.
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 (Knative), Istio, and HTTP Load Balancing will be enabled on the cluster at create time and cannot be installed or uninstalled separately.
For information on adding an existing GKE cluster, see Existing Kubernetes cluster.