# Register Google GKE Cluster

{% hint style="warning" %}
In case of gopaddle community edition, the installer automatically registers the local Kubernetes cluster in gopaddle. Ignore this section if you are running a community edition

In case of SaaS or Enterprise edition, this section needs to be followed to register a cluster
{% endhint %}

1. Install [gcloud CLI](https://cloud.google.com/sdk/docs/install) in your local environment
2. Install **jq**. For instance, you can install **jq** in Ubuntu environments, as below:

```sh
apt update
apt install jq
```

3. Login to your Google Cloud account using gcloud command line utility. For more information check out - <https://cloud.google.com/sdk/gcloud/reference/auth>

```sh
gcloud auth login
```

4. Export the KUBECONFIG environment variable and describe the GKE cluster. This writes the kubernetes configuration to the file specified in the KUBECONFIG environment variable.

```sh
KUBECONFIG=./gke.config  gcloud container clusters describe <clustername> --zone <cluster-zone> --project <project-name> --format json | jq '.masterAuth.clusterCaCertificate'
```

{% hint style="info" %}
If you don't have a Bastion Host setup, and if the **`server`** value in the Kubeconfig points to a private IP address:

a) Replace the **`server`** value to a publicly accessible Cluster Master API Endpoint

b) Make sure the firewall is open for the Cluster Master API port (default 443)

c) Make sure the Cluster certificate is attached to the Public IP. Here is an example of how to update the certSANs with the public IP. - <https://blog.scottlowe.org/2019/07/30/adding-a-name-to-kubernetes-api-server-certificate/>
{% endhint %}

5. Navigate to the **Environments** section.
6. Click on **Add a Cluster** and choose **Register an existing Cluster**.
7. Provide the Google GKE Cluster name. The cluster name must match the cluster name in the Google portal.
8. Choose the Cloud provider as **Google**. Select the Cloud Account and the Google project ID and the Regions.

<figure><img src="/files/KtX5wb13plIkQ4RQqXDV" alt=""><figcaption></figcaption></figure>

9. In the **Authentication** Step, upload the Kubeconfig file gathered in step 2.

<figure><img src="/files/FCrjUeLC0TY8PM17mT4F" alt=""><figcaption><p>Upload the Kubeconfig file</p></figcaption></figure>

10. If you have configured a bastion host, provide the Bastion Host IP, SSH Pem file, SSH port

{% hint style="info" %}
If you are using a Bastion Host setup, make sure the Bastion Host IP and Port are accessible publicly. If you are looking for a private only setup, get in touch with us to  explore gopaddle Enterprises.
{% endhint %}

<figure><img src="/files/xXy7XylFkZIet6s4eyKS" alt=""><figcaption><p>Provide the Bastion Host Connection Details</p></figcaption></figure>

11. Click on **Finish** to register the GKE Cluster.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.gopaddle.io/overview/register-a-cluster/register-google-gke-cluster.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
