> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ankra.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Kubernetes Engine (GKE)

> Provision, import, and operate Google Kubernetes Engine (GKE) clusters with Ankra - Standard and Autopilot, live pricing, node pools, upgrades, GitOps, and AI-assisted operations.

[Google Kubernetes Engine (GKE)](https://cloud.google.com/kubernetes-engine) is Google Cloud's managed Kubernetes service. Google runs the control plane; Ankra provisions the cluster, then manages everything on top - node pools, Kubernetes upgrades, addons, stacks, GitOps, and AI-assisted operations.

This page covers GKE specifically. For the shared concepts across all managed providers - live options, discovery/import, and day-2 API patterns - see [Managed Kubernetes](/guides/managed-kubernetes).

## Why GKE with Ankra

* **Standard or Autopilot** - run node pools you size yourself, or let Google manage nodes with Autopilot.
* **Release channels** - pin the cluster to the `RAPID`, `REGULAR`, or `STABLE` channel.
* **Live pricing and options** - locations, Kubernetes versions, and machine types are fetched live with your service account, including GPU and spot capacity where available.

## Prerequisites

A **GCP service account key** stored in Ankra, with the **Kubernetes Engine Admin** (`roles/container.admin`) and **Service Account User** (`roles/iam.serviceAccountUser`) roles, and the **Kubernetes Engine API** enabled on the project. See [Google Cloud (GCP) Credentials](/platform/credentials/gcp).

GitOps is optional: connect a repository at creation and Ankra commits the cluster's stack definitions to Git.

## Creating a GKE cluster

<Tabs>
  <Tab title="Portal">
    <Steps>
      <Step title="Create Cluster">
        Go to **Clusters** → **Create Cluster** and pick Google Cloud's **Cloud Managed** action.
      </Step>

      <Step title="Credential & Location">
        Select the GCP credential and a location - a zone (`europe-west1-b`) or a region (`europe-west1`). Locations load live from Google Cloud.
      </Step>

      <Step title="Mode & Node Pools">
        Choose **Standard** and define worker pools (name, machine type with live pricing, count, labels, autoscaling), or choose **Autopilot** and let Google manage the nodes.
      </Step>

      <Step title="Kubernetes">
        Pick a Kubernetes version or keep the default, and select a release channel.
      </Step>

      <Step title="GitOps (optional) & Create">
        Optionally connect a Git repository, then create. Ankra runs GKE preflight checks, provisions the cluster, retrieves the kubeconfig, and installs the Ankra Agent.
      </Step>
    </Steps>
  </Tab>

  <Tab title="CLI">
    ```bash theme={null}
    ankra cluster managed create \
      --provider gke \
      --name my-gke-cluster \
      --credential-id <gcp-credential-id> \
      --location europe-west1 \
      --node-pool-name workers \
      --node-pool-size e2-standard-4 \
      --node-pool-count 2
    ```

    The release channel, Autopilot mode, and node-pool autoscaling bounds are set from the portal or the API.
  </Tab>

  <Tab title="API">
    ```bash theme={null}
    curl -X POST https://platform.ankra.app/org/clusters/managed/gke \
      -H "Authorization: Bearer $ANKRA_API_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "name": "my-gke-cluster",
        "credential_id": "<gcp-credential-id>",
        "location": "europe-west1",
        "kubernetes_version": "1.32.3",
        "node_pools": [
          {
            "name": "workers",
            "size": "e2-standard-4",
            "count": 2,
            "autoscaling": {"enabled": true, "min_count": 2, "max_count": 5}
          }
        ],
        "gke": {"release_channel": "REGULAR", "mode": "standard"}
      }'
    ```
  </Tab>
</Tabs>

### GKE options

| Field                 | Description                                                              |
| --------------------- | ------------------------------------------------------------------------ |
| `gke.release_channel` | `RAPID`, `REGULAR`, or `STABLE`                                          |
| `gke.mode`            | `standard` (you manage node pools) or `autopilot` (Google manages nodes) |

<Note>
  **Autopilot** clusters ignore node-pool sizing - Google manages the nodes automatically. Cluster names are lowercase letters, numbers, and hyphens, and must start with a letter.
</Note>

## Day-2 operations

Node pools, upgrades, and deletion work from the CLI, portal, or API. The CLI examples use `--provider gke`:

```bash theme={null}
# scale a pool to a fixed count
ankra cluster managed node-pool scale <cluster_id> workers --provider gke --count 5

# upgrade the cluster
ankra cluster managed upgrade <cluster_id> --provider gke --version 1.32.3

# delete the cluster
ankra cluster managed delete <cluster_id> --provider gke
```

Autoscaling bounds are set from the portal or the `PATCH .../node-pools/{name}` endpoint. See [Managed Kubernetes - day-2 operations](/guides/managed-kubernetes#day-2-operations) for the shared mechanics.

## Importing an existing GKE cluster

Already running GKE? Discover clusters in your project and adopt them into Ankra without touching them. Discovery and import run from the portal or API - see [Managed Kubernetes - importing existing clusters](/guides/managed-kubernetes#importing-existing-clusters).

## Related

* [Managed Kubernetes overview](/guides/managed-kubernetes)
* [Google Cloud (GCP) Credentials](/platform/credentials/gcp)
* [Cluster settings](/platform/cluster-settings)
